示例#1
0
 def test_getcfg_and_config(self, testdir, tmpdir, section, filename):
     sub = tmpdir.mkdir("sub")
     sub.chdir()
     tmpdir.join(filename).write(
         textwrap.dedent("""\
             [{section}]
             name = value
             """.format(section=section)))
     _, _, cfg = getcfg([sub])
     assert cfg["name"] == "value"
     config = testdir.parseconfigure(sub)
     assert config.inicfg["name"] == "value"
示例#2
0
 def test_getcfg_and_config(self, testdir, tmpdir, section, filename):
     sub = tmpdir.mkdir("sub")
     sub.chdir()
     tmpdir.join(filename).write(
         _pytest._code.Source("""
         [{section}]
         name = value
     """.format(section=section)))
     rootdir, inifile, cfg = getcfg([sub])
     assert cfg["name"] == "value"
     config = testdir.parseconfigure(sub)
     assert config.inicfg["name"] == "value"
示例#3
0
 def test_getcfg_and_config(self, testdir, tmpdir, section, filename):
     sub = tmpdir.mkdir("sub")
     sub.chdir()
     tmpdir.join(filename).write(
         _pytest._code.Source(
             """
         [{section}]
         name = value
     """.format(
                 section=section
             )
         )
     )
     rootdir, inifile, cfg = getcfg([sub])
     assert cfg["name"] == "value"
     config = testdir.parseconfigure(sub)
     assert config.inicfg["name"] == "value"
示例#4
0
 def test_getcfg_empty_path(self):
     """correctly handle zero length arguments (a la pytest '')"""
     getcfg([""])
示例#5
0
 def test_getcfg_empty_path(self):
     """correctly handle zero length arguments (a la pytest '')"""
     getcfg([""])