diff --git a/testing/benchmark.py b/testing/benchmark.py index 4cd7781c..cca4a759 100644 --- a/testing/benchmark.py +++ b/testing/benchmark.py @@ -10,12 +10,12 @@ hookimpl = HookimplMarker("example") -def MC(methods, kwargs, callertype, firstresult=False): +def MC(methods, kwargs, firstresult=False): hookfuncs = [] for method in methods: f = HookImpl(None, "", method, method.example_impl) hookfuncs.append(f) - return callertype(hookfuncs, kwargs, firstresult=firstresult) + return _multicall(hookfuncs, kwargs, firstresult=firstresult) @hookimpl @@ -38,14 +38,9 @@ def wrappers(request): return [wrapper for i in range(request.param)] -@pytest.fixture(params=[_multicall], ids=lambda item: item.__name__) -def callertype(request): - return request.param +def inner_exec(methods): + return MC(methods, {"arg1": 1, "arg2": 2, "arg3": 3}) -def inner_exec(methods, callertype): - return MC(methods, {"arg1": 1, "arg2": 2, "arg3": 3}, callertype) - - -def test_hook_and_wrappers_speed(benchmark, hooks, wrappers, callertype): - benchmark(inner_exec, hooks + wrappers, callertype) +def test_hook_and_wrappers_speed(benchmark, hooks, wrappers): + benchmark(inner_exec, hooks + wrappers)