Skip to content

Commit 00ab02e

Browse files
Merge pull request #77 from nicoddemus/deprecated-warning-error
Fix error while issuing DeprecationWarning for __multicall__ usage
2 parents 9f7cdc2 + bf3f0ba commit 00ab02e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,15 @@ 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+
pass
345+
346+
pytest.deprecated_call(pm.register, P1())
347+
348+
340349
def test_add_hookspecs_nohooks(pm):
341350
with pytest.raises(ValueError):
342351
pm.add_hookspecs(10)

0 commit comments

Comments
 (0)