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:
Florian Bruhin 2015-11-17 21:29:24 +01:00
parent 1d1d8063ec
commit f75208d5f7
1 changed files with 6 additions and 1 deletions

View File

@ -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')