Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pytest >= 4 #23

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions capybara/pytest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@


def pytest_runtest_setup(item):
if item.get_marker("js"):
if item.get_closest_marker("js"):
capybara.current_driver = capybara.javascript_driver

driver = item.get_marker("driver")
driver = item.get_closest_marker("driver")
if driver:
assert len(driver.args) == 1, "exactly one driver must be specified"
capybara.current_driver = driver.args[0]
Expand Down
2 changes: 1 addition & 1 deletion capybara/tests/pytest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def pytest_pycollect_makeitem(collector, name, obj):
@pytest.hookimpl(tryfirst=True)
def pytest_runtest_setup(item):
# See if this test ``requires`` any special driver features.
requires = item.get_marker("requires")
requires = item.get_closest_marker("requires")
if requires is not None:
driver = item.getparent(Driver).obj

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"flaky",
"flask",
"py",
"pytest ~= 3.0, != 3.3.*, < 3.7",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove support for earlier versions of pytest?

"pytest >= 4.0",
"werkzeug"]
if sys.version_info < (3, 3):
driver_verification_tests_require.append("mock")
Expand Down