From 323b1812279c1251e123523dfed253b0031e094e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 5 Aug 2016 14:36:32 +0200 Subject: [PATCH] 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... --- tests/conftest.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index bd2fdd7c4..e6fff31ae 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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')