MCPcopy
hub / github.com/pytest-dev/pytest / test_simple_noini

Method test_simple_noini

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

Source from the content-addressed store, hash-verified

1908
1909class TestRootdir:
1910 def test_simple_noini(self, tmp_path: Path, monkeypatch: MonkeyPatch) -> None:
1911 assert get_common_ancestor(Path.cwd(), [tmp_path]) == tmp_path
1912 a = tmp_path / "a"
1913 a.mkdir()
1914 assert get_common_ancestor(Path.cwd(), [a, tmp_path]) == tmp_path
1915 assert get_common_ancestor(Path.cwd(), [tmp_path, a]) == tmp_path
1916 monkeypatch.chdir(tmp_path)
1917 assert get_common_ancestor(Path.cwd(), []) == tmp_path
1918 no_path = tmp_path / "does-not-exist"
1919 assert get_common_ancestor(Path.cwd(), [no_path]) == tmp_path
1920 assert get_common_ancestor(Path.cwd(), [no_path / "a"]) == tmp_path
1921
1922 @pytest.mark.parametrize(
1923 "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