Skip to content

Commit 09d7589

Browse files
author
Tyler Goodlet
committed
Adjust tests to use legacy multicall when necessary
1 parent 845c502 commit 09d7589

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

testing/test_multicall.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from pluggy import _MultiCall, HookImpl, HookCallError
3+
from pluggy import _MultiCall, HookImpl, HookCallError, _LegacyMultiCall
44
from pluggy import HookspecMarker, HookimplMarker
55

66

@@ -18,11 +18,14 @@ def test_uses_copy_of_methods():
1818

1919

2020
def MC(methods, kwargs, firstresult=False):
21+
caller = _MultiCall
2122
hookfuncs = []
2223
for method in methods:
2324
f = HookImpl(None, "<temp>", method, method.example_impl)
2425
hookfuncs.append(f)
25-
return _MultiCall(hookfuncs, kwargs, {"firstresult": firstresult})
26+
if '__multicall__' in f.argnames:
27+
caller = _LegacyMultiCall
28+
return caller(hookfuncs, kwargs, {"firstresult": firstresult})
2629

2730

2831
def test_call_passing():

0 commit comments

Comments
 (0)