Skip to content

Commit 77578ad

Browse files
author
Tyler Goodlet
committed
Expect deprecation warnings throughout tests
1 parent 39f2136 commit 77578ad

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

testing/test_method_ordering.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ def he_method1(self):
291291

292292
@pytest.mark.parametrize('include_hookspec', [True, False])
293293
def test_prefix_hookimpl(include_hookspec):
294-
pm = PluginManager(hookspec.project_name, "hello_")
294+
with pytest.deprecated_call():
295+
pm = PluginManager(hookspec.project_name, "hello_")
295296

296297
if include_hookspec:
297298
class HookSpec(object):
@@ -305,14 +306,16 @@ class Plugin(object):
305306
def hello_myhook(self, arg1):
306307
return arg1 + 1
307308

308-
pm.register(Plugin())
309-
pm.register(Plugin())
309+
with pytest.deprecated_call():
310+
pm.register(Plugin())
311+
pm.register(Plugin())
310312
results = pm.hook.hello_myhook(arg1=17)
311313
assert results == [18, 18]
312314

313315

314316
def test_prefix_hookimpl_dontmatch_module():
315-
pm = PluginManager(hookspec.project_name, "hello_")
317+
with pytest.deprecated_call():
318+
pm = PluginManager(hookspec.project_name, "hello_")
316319

317320
class BadPlugin(object):
318321
hello_module = __import__('email')

testing/test_pluginmanager.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,14 @@ def example_hook():
393393
""")
394394
exec(src, conftest.__dict__)
395395
conftest.example_blah = types.ModuleType("example_blah")
396-
name = pm.register(conftest)
396+
with pytest.deprecated_call():
397+
name = pm.register(conftest)
397398
assert name == 'conftest'
398399
assert getattr(pm.hook, 'example_blah', None) is None
399400
assert getattr(pm.hook, 'example_hook', None) # conftest.example_hook should be collected
400-
assert pm.parse_hookimpl_opts(conftest, 'example_blah') is None
401-
assert pm.parse_hookimpl_opts(conftest, 'example_hook') == {}
401+
with pytest.deprecated_call():
402+
assert pm.parse_hookimpl_opts(conftest, 'example_blah') is None
403+
assert pm.parse_hookimpl_opts(conftest, 'example_hook') == {}
402404

403405

404406
def test_callhistoric_proc_deprecated(pm):

0 commit comments

Comments
 (0)