Skip to content

Commit

Permalink
Drop callertype fixture from benchmark tests
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Jun 3, 2020
1 parent b39f373 commit 72948af
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions testing/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<temp>", method, method.example_impl)
hookfuncs.append(f)
return callertype(hookfuncs, kwargs, firstresult=firstresult)
return _multicall(hookfuncs, kwargs, firstresult=firstresult)


@hookimpl
Expand All @@ -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)

0 comments on commit 72948af

Please sign in to comment.