File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -291,7 +291,8 @@ def he_method1(self):
291
291
292
292
@pytest .mark .parametrize ('include_hookspec' , [True , False ])
293
293
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_" )
295
296
296
297
if include_hookspec :
297
298
class HookSpec (object ):
@@ -305,14 +306,16 @@ class Plugin(object):
305
306
def hello_myhook (self , arg1 ):
306
307
return arg1 + 1
307
308
308
- pm .register (Plugin ())
309
- pm .register (Plugin ())
309
+ with pytest .deprecated_call ():
310
+ pm .register (Plugin ())
311
+ pm .register (Plugin ())
310
312
results = pm .hook .hello_myhook (arg1 = 17 )
311
313
assert results == [18 , 18 ]
312
314
313
315
314
316
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_" )
316
319
317
320
class BadPlugin (object ):
318
321
hello_module = __import__ ('email' )
Original file line number Diff line number Diff line change @@ -393,12 +393,14 @@ def example_hook():
393
393
""" )
394
394
exec (src , conftest .__dict__ )
395
395
conftest .example_blah = types .ModuleType ("example_blah" )
396
- name = pm .register (conftest )
396
+ with pytest .deprecated_call ():
397
+ name = pm .register (conftest )
397
398
assert name == 'conftest'
398
399
assert getattr (pm .hook , 'example_blah' , None ) is None
399
400
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' ) == {}
402
404
403
405
404
406
def test_callhistoric_proc_deprecated (pm ):
You can’t perform that action at this time.
0 commit comments