How to use the pluggy.HookImpl 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 web-platform-tests / wpt / tools / third_party / pluggy / testing / test_method_ordering.py View on Github external
def wrap(func):
            hookimpl(tryfirst=tryfirst, trylast=trylast,
                     hookwrapper=hookwrapper)(func)
            hc._add_hookimpl(HookImpl(None, "", func, func.example_impl))
            return func
        return wrap
github pytest-dev / pluggy / testing / test_pluggy.py View on Github external
def MC(self, 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 web-platform-tests / wpt / tools / third_party / pluggy / testing / benchmark.py View on Github external
def MC(methods, kwargs, callertype, firstresult=False):
    hookfuncs = []
    for method in methods:
        f = HookImpl(None, "", method, method.example_impl)
        hookfuncs.append(f)
    return callertype(hookfuncs, kwargs, {"firstresult": firstresult})
github web-platform-tests / wpt / tools / third_party / 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)
        if '__multicall__' in f.argnames:
            caller = _legacymulticall
    return caller(hookfuncs, kwargs, firstresult=firstresult)
github pytest-dev / pluggy / testing / test_pluggy.py View on Github external
def wrap(func):
                hookimpl(tryfirst=tryfirst, trylast=trylast,
                         hookwrapper=hookwrapper)(func)
                hc._add_hookimpl(HookImpl(None, "", func, func.example_impl))
                return func
            return wrap