pytest 2.7 compatibility.
This commit is contained in:
parent
33f1ff4e8c
commit
bd9495486b
|
@ -1,4 +1,12 @@
|
|||
import pytest
|
||||
|
||||
try:
|
||||
from _pytest.cacheprovider import Cache
|
||||
except ImportError:
|
||||
from pytest_cache import Cache
|
||||
|
||||
|
||||
if hasattr(pytest, 'hookimpl'):
|
||||
tryfirst = pytest.hookimpl(tryfirst=True)
|
||||
else:
|
||||
tryfirst = pytest.mark.tryfirst
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import pytest
|
||||
from .compat import Cache
|
||||
from .compat import Cache, tryfirst
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
|
@ -12,7 +11,7 @@ def pytest_addoption(parser):
|
|||
help='ignore the first failing test but stop on the next failing test')
|
||||
|
||||
|
||||
@pytest.hookimpl(tryfirst=True)
|
||||
@tryfirst
|
||||
def pytest_configure(config):
|
||||
config.cache = Cache(config)
|
||||
config.pluginmanager.register(StepwisePlugin(config), 'stepwiseplugin')
|
||||
|
|
Loading…
Reference in New Issue