MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_with_ini

Method test_with_ini

testing/test_config.py:1346–1361  ·  view source on GitHub ↗
(self, tmp_path: Path, name: str, contents: str)

Source from the content-addressed store, hash-verified

1344 ],
1345 )
1346 def test_with_ini(self, tmp_path: Path, name: str, contents: str) -> None:
1347 inipath = tmp_path / name
1348 inipath.write_text(contents, "utf-8")
1349
1350 a = tmp_path / "a"
1351 a.mkdir()
1352 b = a / "b"
1353 b.mkdir()
1354 for args in ([str(tmp_path)], [str(a)], [str(b)]):
1355 rootpath, parsed_inipath, _ = determine_setup(None, args)
1356 assert rootpath == tmp_path
1357 assert parsed_inipath == inipath
1358 rootpath, parsed_inipath, ini_config = determine_setup(None, [str(b), str(a)])
1359 assert rootpath == tmp_path
1360 assert parsed_inipath == inipath
1361 assert ini_config == {"x": "10"}
1362
1363 @pytest.mark.parametrize("name", ["setup.cfg", "tox.ini"])
1364 def test_pytestini_overrides_empty_other(self, tmp_path: Path, name: str) -> None:

Callers

nothing calls this directly

Calls 2

determine_setupFunction · 0.90
mkdirMethod · 0.45

Tested by

no test coverage detected