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

Function test_hook_proxy

testing/test_conftest.py:661–680  ·  view source on GitHub ↗

Session's gethookproxy() would cache conftests incorrectly (#2016). It was decided to remove the cache altogether.

(pytester: Pytester)

Source from the content-addressed store, hash-verified

659
660
661def test_hook_proxy(pytester: Pytester) -> None:
662 """Session's gethookproxy() would cache conftests incorrectly (#2016).
663 It was decided to remove the cache altogether.
664 """
665 pytester.makepyfile(
666 **{
667 "root/demo-0/test_foo1.py": "def test1(): pass",
668 "root/demo-a/test_foo2.py": "def test1(): pass",
669 "root/demo-a/conftest.py": """\
670 def pytest_ignore_collect(collection_path, config):
671 return True
672 """,
673 "root/demo-b/test_foo3.py": "def test1(): pass",
674 "root/demo-c/test_foo4.py": "def test1(): pass",
675 }
676 )
677 result = pytester.runpytest()
678 result.stdout.fnmatch_lines(
679 ["*test_foo1.py*", "*test_foo3.py*", "*test_foo4.py*", "*3 passed*"]
680 )
681
682
683def test_required_option_help(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

fnmatch_linesMethod · 0.80
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected