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

Function test_setinitial_conftest_subdirs

testing/test_conftest.py:221–233  ·  view source on GitHub ↗
(pytester: Pytester, name: str)

Source from the content-addressed store, hash-verified

219
220@pytest.mark.parametrize("name", "test tests whatever .dotdir".split())
221def test_setinitial_conftest_subdirs(pytester: Pytester, name: str) -> None:
222 sub = pytester.mkdir(name)
223 subconftest = sub.joinpath("conftest.py")
224 subconftest.touch()
225 conftest = PytestPluginManager()
226 conftest_setinitial(conftest, [sub.parent], confcutdir=pytester.path)
227 key = subconftest.resolve()
228 if name not in ("whatever", ".dotdir"):
229 assert key in conftest._conftestpath2mod
230 assert len(conftest._conftestpath2mod) == 1
231 else:
232 assert key not in conftest._conftestpath2mod
233 assert len(conftest._conftestpath2mod) == 0
234
235
236def test_conftest_confcutdir(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

PytestPluginManagerClass · 0.90
conftest_setinitialFunction · 0.85
mkdirMethod · 0.45

Tested by

no test coverage detected