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

Method test_simple_noini

testing/test_config.py:1323–1333  ·  view source on GitHub ↗
(self, tmp_path: Path, monkeypatch: MonkeyPatch)

Source from the content-addressed store, hash-verified

1321
1322class TestRootdir:
1323 def test_simple_noini(self, tmp_path: Path, monkeypatch: MonkeyPatch) -> None:
1324 assert get_common_ancestor([tmp_path]) == tmp_path
1325 a = tmp_path / "a"
1326 a.mkdir()
1327 assert get_common_ancestor([a, tmp_path]) == tmp_path
1328 assert get_common_ancestor([tmp_path, a]) == tmp_path
1329 monkeypatch.chdir(tmp_path)
1330 assert get_common_ancestor([]) == tmp_path
1331 no_path = tmp_path / "does-not-exist"
1332 assert get_common_ancestor([no_path]) == tmp_path
1333 assert get_common_ancestor([no_path / "a"]) == tmp_path
1334
1335 @pytest.mark.parametrize(
1336 "name, contents",

Callers

nothing calls this directly

Calls 3

get_common_ancestorFunction · 0.90
mkdirMethod · 0.45
chdirMethod · 0.45

Tested by

no test coverage detected