From e8edd0f7a2ee4a7796048cc8f2a4df3769c1c69e Mon Sep 17 00:00:00 2001 From: Ian Lesperance Date: Tue, 30 Jan 2018 22:20:03 -0500 Subject: [PATCH] Allow pytest versions 3.4.* pytest-dev/pytest#3074 is resolved as of 3.4.0. --- capybara/tests/collector.py | 8 +++++++- setup.py | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/capybara/tests/collector.py b/capybara/tests/collector.py index 71b6638..7383250 100644 --- a/capybara/tests/collector.py +++ b/capybara/tests/collector.py @@ -1,6 +1,12 @@ import py.path from _pytest.config import Config, PytestPluginManager, default_plugins -from _pytest.main import FSCollector + +try: + # pytest >= 3.4 + from _pytest.nodes import FSCollector +except ImportError: + # pytest < 3.4 + from _pytest.main import FSCollector class GraftedSubSession(FSCollector): diff --git a/setup.py b/setup.py index 6af4fd0..8a780e8 100644 --- a/setup.py +++ b/setup.py @@ -11,8 +11,7 @@ "flaky", "flask", "py", - # See: https://github.com/pytest-dev/pytest/issues/3074 - "pytest >= 3, < 3.3", + "pytest ~= 3.0, != 3.3.*, < 3.5", "werkzeug"] if sys.version_info < (3, 3): driver_verification_tests_require.append("mock")