def test_hookrecorder_basic(holder) -> None: pm = PytestPluginManager() pm.add_hookspecs(holder) rec = HookRecorder(pm) pm.hook.pytest_xyz(arg=123) call = rec.popcall("pytest_xyz") assert call.arg == 123 assert call._name == "pytest_xyz" pytest.raises(Failed, rec.popcall, "abc") pm.hook.pytest_xyz_noarg() call = rec.popcall("pytest_xyz_noarg") assert call._name == "pytest_xyz_noarg"
def test_hookrecorder_basic(holder): pm = PytestPluginManager() pm.add_hookspecs(holder) rec = HookRecorder(pm) pm.hook.pytest_xyz(arg=123) call = rec.popcall("pytest_xyz") assert call.arg == 123 assert call._name == "pytest_xyz" pytest.raises(pytest.fail.Exception, rec.popcall, "abc") pm.hook.pytest_xyz_noarg() call = rec.popcall("pytest_xyz_noarg") assert call._name == "pytest_xyz_noarg"
def pytest_addhooks(pluginmanager: PytestPluginManager) -> None: from pytest_pdf import hook_specs pluginmanager.add_hookspecs(hook_specs)
def pytest_addhooks(pluginmanager: PytestPluginManager) -> None: pluginmanager.add_hookspecs(hooks)
def pytest_addhooks(pluginmanager: PytestPluginManager) -> None: from infrastructure.hookspecs import InfrastructureHookSpecs pluginmanager.add_hookspecs(InfrastructureHookSpecs)