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

Function test_hookrecorder_basic

testing/test_pytester.py:192–204  ·  view source on GitHub ↗
(holder)

Source from the content-addressed store, hash-verified

190
191@pytest.mark.parametrize("holder", make_holder())
192def test_hookrecorder_basic(holder) -> None:
193 pm = PytestPluginManager()
194 pm.add_hookspecs(holder)
195 rec = HookRecorder(pm, _ispytest=True)
196 pm.hook.pytest_xyz(arg=123)
197 call = rec.popcall("pytest_xyz")
198 assert call.arg == 123
199 assert call._name == "pytest_xyz"
200 with pytest.raises(pytest.fail.Exception):
201 rec.popcall("abc")
202 pm.hook.pytest_xyz_noarg()
203 call = rec.popcall("pytest_xyz_noarg")
204 assert call._name == "pytest_xyz_noarg"
205
206
207def test_makepyfile_unicode(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 5

popcallMethod · 0.95
PytestPluginManagerClass · 0.90
HookRecorderClass · 0.90
pytest_xyzMethod · 0.80
pytest_xyz_noargMethod · 0.80

Tested by

no test coverage detected