We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0e7970a + 4a0153e commit 4576615Copy full SHA for 4576615
testing/test_invocations.py
@@ -213,3 +213,19 @@ def hello(self, arg):
213
pm.add_hookspecs(Api)
214
res = pm.hook.hello(arg=3)
215
assert res is None
216
+
217
218
+def test_no_hookspec(pm: PluginManager) -> None:
219
+ """A hook with hookimpls can still be called even if no hookspec
220
+ was registered for it (and call_pending wasn't called to check
221
+ against it).
222
+ """
223
224
+ class Plugin:
225
+ @hookimpl
226
+ def hello(self, arg):
227
+ return "Plugin.hello"
228
229
+ pm.register(Plugin())
230
231
+ assert pm.hook.hello(arg=10, extra=20) == ["Plugin.hello"]
0 commit comments