Automatically skip BDD tests on pytest 3.0

See https://github.com/pytest-dev/pytest-bdd/pull/193
This at least allows us to play with pytest 3.0 a bit...
This commit is contained in:
Florian Bruhin 2016-08-05 14:36:32 +02:00
parent 747be14118
commit 323b181227

View File

@ -120,10 +120,11 @@ def pytest_collection_modifyitems(items):
def pytest_ignore_collect(path):
"""Ignore BDD tests during collection if frozen."""
"""Ignore BDD tests if we're unable to run them."""
skip_bdd = (hasattr(sys, 'frozen') or
int(pytest.__version__.split('.')[0]) == 3)
rel_path = path.relto(os.path.dirname(__file__))
return (rel_path == os.path.join('end2end', 'features') and
hasattr(sys, 'frozen'))
return rel_path == os.path.join('end2end', 'features') and skip_bdd
@pytest.fixture(scope='session')