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"
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"
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"
def test_getcfg_empty_path(self): """correctly handle zero length arguments (a la pytest '')""" getcfg([""])