Skip to content

Commit 672a98b

Browse files
committed
Fix error while issuing DeprecationWarning for __multicall__ usage
Fix #75
1 parent 9f7cdc2 commit 672a98b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

pluggy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ def _add_hookimpl(self, hookimpl):
657657
warnings.warn(
658658
"Support for __multicall__ is now deprecated and will be"
659659
"removed in an upcoming release.",
660-
warnings.DeprecationWarning
660+
DeprecationWarning
661661
)
662662
self.multicall = _LegacyMultiCall
663663

testing/test_pluginmanager.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,18 @@ class PluginNo(object):
337337
assert l == [10]
338338

339339

340+
def test_multicall_deprecated(pm):
341+
class P1(object):
342+
@hookimpl
343+
def m(self, __multicall__, x):
344+
assert len(__multicall__.results) == 1
345+
assert not __multicall__.hook_impls
346+
return 17
347+
348+
with pytest.deprecated_call():
349+
pm.register(P1())
350+
351+
340352
def test_add_hookspecs_nohooks(pm):
341353
with pytest.raises(ValueError):
342354
pm.add_hookspecs(10)

0 commit comments

Comments
 (0)