Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_call_with_too_few_args(pm):
class Hooks:
@hookspec
def he_method1(self, arg):
pass
pm.add_hookspecs(Hooks)
class Plugin1:
@hookimpl
def he_method1(self, arg):
0 / 0
pm.register(Plugin1())
with pytest.raises(HookCallError):
with pytest.warns(UserWarning):
pm.hook.he_method1()
def test_tags_call_error():
@hookimpl
def f(x):
return x
with pytest.raises(HookCallError):
MC([f], {})
def test_tags_call_error(self):
@hookimpl
def f(x):
return x
multicall = self.MC([f], {})
pytest.raises(HookCallError, multicall.execute)
def test_tags_call_error():
@hookimpl
def f(x):
return x
with pytest.raises(HookCallError):
MC([f], {})