add compat for pytest 3.7 and tox config for (some of) the versions i could still get working

This commit is contained in:
David Szotten 2018-08-01 11:48:15 +01:00
parent bd9495486b
commit d9c428c1de
2 changed files with 10 additions and 1 deletions

View File

@ -5,6 +5,12 @@ try:
except ImportError:
from pytest_cache import Cache
try:
# pytest 3.7+
Cache = Cache.for_config
except AttributeError:
pass
if hasattr(pytest, 'hookimpl'):
tryfirst = pytest.hookimpl(tryfirst=True)

View File

@ -132,4 +132,7 @@ def test_stop_on_collection_errors(broken_testdir):
result = broken_testdir.runpytest('-v', '--strict', '--stepwise', 'working_testfile.py', 'broken_testfile.py')
stdout = result.stdout.str()
if pytest.__version__ < '3.0.0':
assert 'Error when collecting test' in stdout
else:
assert 'errors during collection' in stdout