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

Function test_fscollector_gethookproxy_isinitpath

testing/deprecated_test.py:79–101  ·  view source on GitHub ↗
(pytester: Pytester)

Source from the content-addressed store, hash-verified

77
78
79def test_fscollector_gethookproxy_isinitpath(pytester: Pytester) -> None:
80 module = pytester.getmodulecol(
81 """
82 def test_foo(): pass
83 """,
84 withinit=True,
85 )
86 assert isinstance(module, pytest.Module)
87 package = module.parent
88 assert isinstance(package, pytest.Package)
89
90 with pytest.warns(pytest.PytestDeprecationWarning, match="gethookproxy"):
91 package.gethookproxy(pytester.path)
92
93 with pytest.warns(pytest.PytestDeprecationWarning, match="isinitpath"):
94 package.isinitpath(pytester.path)
95
96 # The methods on Session are *not* deprecated.
97 session = module.session
98 with warnings.catch_warnings(record=True) as rec:
99 session.gethookproxy(pytester.path)
100 session.isinitpath(pytester.path)
101 assert len(rec) == 0
102
103
104def test_strict_option_is_deprecated(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

getmodulecolMethod · 0.45
gethookproxyMethod · 0.45
isinitpathMethod · 0.45

Tested by

no test coverage detected