How to use the pluggy.HookCallError function in pluggy

To help you get started, we’ve selected a few pluggy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pytest-dev / pluggy / testing / test_pluginmanager.py View on Github external
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()
github pytest-dev / pluggy / testing / test_multicall.py View on Github external
def test_tags_call_error():
    @hookimpl
    def f(x):
        return x

    with pytest.raises(HookCallError):
        MC([f], {})
github pytest-dev / pluggy / testing / test_pluggy.py View on Github external
def test_tags_call_error(self):
        @hookimpl
        def f(x):
            return x
        multicall = self.MC([f], {})
        pytest.raises(HookCallError, multicall.execute)
github web-platform-tests / wpt / tools / third_party / pluggy / testing / test_multicall.py View on Github external
def test_tags_call_error():
    @hookimpl
    def f(x):
        return x
    with pytest.raises(HookCallError):
        MC([f], {})