diff --git a/testing/test_method_ordering.py b/testing/test_method_ordering.py index 7dff9604..308aa592 100644 --- a/testing/test_method_ordering.py +++ b/testing/test_method_ordering.py @@ -291,7 +291,8 @@ def he_method1(self): @pytest.mark.parametrize('include_hookspec', [True, False]) def test_prefix_hookimpl(include_hookspec): - pm = PluginManager(hookspec.project_name, "hello_") + with pytest.deprecated_call(): + pm = PluginManager(hookspec.project_name, "hello_") if include_hookspec: class HookSpec(object): @@ -305,14 +306,16 @@ class Plugin(object): def hello_myhook(self, arg1): return arg1 + 1 - pm.register(Plugin()) - pm.register(Plugin()) + with pytest.deprecated_call(): + pm.register(Plugin()) + pm.register(Plugin()) results = pm.hook.hello_myhook(arg1=17) assert results == [18, 18] def test_prefix_hookimpl_dontmatch_module(): - pm = PluginManager(hookspec.project_name, "hello_") + with pytest.deprecated_call(): + pm = PluginManager(hookspec.project_name, "hello_") class BadPlugin(object): hello_module = __import__('email') diff --git a/testing/test_pluginmanager.py b/testing/test_pluginmanager.py index 67757449..351bdce6 100644 --- a/testing/test_pluginmanager.py +++ b/testing/test_pluginmanager.py @@ -393,12 +393,14 @@ def example_hook(): """) exec(src, conftest.__dict__) conftest.example_blah = types.ModuleType("example_blah") - name = pm.register(conftest) + with pytest.deprecated_call(): + name = pm.register(conftest) assert name == 'conftest' assert getattr(pm.hook, 'example_blah', None) is None assert getattr(pm.hook, 'example_hook', None) # conftest.example_hook should be collected - assert pm.parse_hookimpl_opts(conftest, 'example_blah') is None - assert pm.parse_hookimpl_opts(conftest, 'example_hook') == {} + with pytest.deprecated_call(): + assert pm.parse_hookimpl_opts(conftest, 'example_blah') is None + assert pm.parse_hookimpl_opts(conftest, 'example_hook') == {} def test_callhistoric_proc_deprecated(pm):