How to use the pluggy._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 / testing / test_pluggy.py View on Github external
def test_uses_copy_of_methods(self):
        l = [lambda: 42]
        mc = _MultiCall(l, {})
        repr(mc)
        l[:] = []
        res = mc.execute()
        return res == 42
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})