Skip to content

Commit

Permalink
Merge pull request #77 from nicoddemus/deprecated-warning-error
Browse files Browse the repository at this point in the history
Fix error while issuing DeprecationWarning for __multicall__ usage
  • Loading branch information
RonnyPfannschmidt authored Aug 31, 2017
2 parents 9f7cdc2 + bf3f0ba commit 00ab02e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pluggy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ def _add_hookimpl(self, hookimpl):
warnings.warn(
"Support for __multicall__ is now deprecated and will be"
"removed in an upcoming release.",
warnings.DeprecationWarning
DeprecationWarning
)
self.multicall = _LegacyMultiCall

Expand Down
9 changes: 9 additions & 0 deletions testing/test_pluginmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,15 @@ class PluginNo(object):
assert l == [10]


def test_multicall_deprecated(pm):
class P1(object):
@hookimpl
def m(self, __multicall__, x):
pass

pytest.deprecated_call(pm.register, P1())


def test_add_hookspecs_nohooks(pm):
with pytest.raises(ValueError):
pm.add_hookspecs(10)

0 comments on commit 00ab02e

Please sign in to comment.