Use add_hookspecs instead of addhooks. See #154.
pluginmanager.addhooks was deprecated in pytest 2.8 and pluggy's add_hookspecs should be used instead. Falling back to addhooks for older pytest versions.
This commit is contained in:
parent
1d1d8063ec
commit
f75208d5f7
|
@ -18,7 +18,12 @@ from .fixtures import *
|
|||
def pytest_addhooks(pluginmanager):
|
||||
"""Register plugin hooks."""
|
||||
from pytest_bdd import hooks
|
||||
pluginmanager.addhooks(hooks)
|
||||
try:
|
||||
# pytest >= 2.8
|
||||
pluginmanager.add_hookspecs(hooks)
|
||||
except AttributeError:
|
||||
# pytest < 2.8
|
||||
pluginmanager.addhooks(hooks)
|
||||
|
||||
|
||||
@given('trace')
|
||||
|
|
Loading…
Reference in New Issue