Skip to content

Commit

Permalink
Merge pull request #19 from carljm/fix-pytest-deprecation-warning
Browse files Browse the repository at this point in the history
Fix deprecation warning for use of pluginmanager.addhooks method.
  • Loading branch information
olegpidsadnyi committed Feb 4, 2016
2 parents be69565 + 0cd087d commit 71bb450
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pytest_factoryboy/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,6 @@ def pytest_runtest_call(item):
def pytest_addhooks(pluginmanager):
"""Register plugin hooks."""
from pytest_factoryboy import hooks
pluginmanager.addhooks(hooks)
# addhooks is for older py.test and deprecated; replaced by add_hookspecs
add_hookspecs = getattr(pluginmanager, 'add_hookspecs', pluginmanager.addhooks)
add_hookspecs(hooks)

0 comments on commit 71bb450

Please sign in to comment.