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

Function test_hookrecorder_basic

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

Source from the content-addressed store, hash-verified

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