diff --git a/testing/test_hookrelay.py b/testing/test_hookrelay.py index 89223fab..8d0447fd 100644 --- a/testing/test_hookrelay.py +++ b/testing/test_hookrelay.py @@ -113,3 +113,17 @@ def hello(self, arg): pm.register(Plugin1()) res = pm.hook.hello(arg=3) assert res == None + + +def test_firstresult_no_plugin(pm): + """If no implementations/plugins have been registered for a firstresult + hook the multi-call loop should return a None value. + """ + class Api(object): + @hookspec(firstresult=True) + def hello(self, arg): + "api hook 1" + + pm.add_hookspecs(Api) + res = pm.hook.hello(arg=3) + assert res == None