How to use the pluggy.callers._multicall 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 / pluggy / hooks.py View on Github external
def __init__(self, name, hook_execute, specmodule_or_class=None, spec_opts=None):
        self.name = name
        self._wrappers = []
        self._nonwrappers = []
        self._hookexec = hook_execute
        self.argnames = None
        self.kwargnames = None
        self.multicall = _multicall
        self.spec = None
        if specmodule_or_class is not None:
            assert spec_opts is not None
            self.set_specification(specmodule_or_class, spec_opts)
github pytest-dev / pluggy / testing / benchmark.py View on Github external
def MC(methods, kwargs, firstresult=False):
    hookfuncs = []
    for method in methods:
        f = HookImpl(None, "", method, method.example_impl)
        hookfuncs.append(f)
    return _multicall(hookfuncs, kwargs, firstresult=firstresult)
github pytest-dev / pluggy / testing / test_multicall.py View on Github external
def MC(methods, kwargs, firstresult=False):
    caller = _multicall
    hookfuncs = []
    for method in methods:
        f = HookImpl(None, "", method, method.example_impl)
        hookfuncs.append(f)
    return caller("foo", hookfuncs, kwargs, firstresult)