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

Function test_setinitial_conftest_subdirs

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

Source from the content-addressed store, hash-verified

250
251@pytest.mark.parametrize("name", "test tests whatever .dotdir".split())
252def test_setinitial_conftest_subdirs(pytester: Pytester, name: str) -> None:
253 sub = pytester.mkdir(name)
254 subconftest = sub.joinpath("conftest.py")
255 subconftest.touch()
256 pm = PytestPluginManager()
257 conftest_setinitial(pm, [sub.parent], confcutdir=pytester.path)
258 key = subconftest.resolve()
259 if name not in ("whatever", ".dotdir"):
260 assert pm.has_plugin(str(key))
261 assert len(set(pm.get_plugins()) - {pm}) == 1
262 else:
263 assert not pm.has_plugin(str(key))
264 assert len(set(pm.get_plugins()) - {pm}) == 0
265
266
267def test_conftest_confcutdir(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 4

PytestPluginManagerClass · 0.90
conftest_setinitialFunction · 0.85
has_pluginMethod · 0.80
mkdirMethod · 0.45

Tested by

no test coverage detected