Skip to content

Restore compatibility with pytest>=7.0,<7.2 #660

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

Merged
merged 3 commits into from
Nov 8, 2023

Conversation

seifertm
Copy link
Contributor

Pytest-asyncio v0.22.0 makes use of _pytest.mark.structures.get_unpacked_marks. It explicitly passes the consider_mro keyword argument which has only been added in pytest v7.2. This lead to breakage for users of with pytest>=7.0,<7.2.
The error has not been uncovered by the test suite, due to wrong configuration of the pytest-min tox environment.

This PR fixes the pytest-min test environment, adjusts the pinned dependencies for this environment, and issues the call to get_unpacked_marks in a way that is backwards compatible with older pytest versions.

Fixes #654

…m correctly using the minimum pytest version.

The "deps" option does not specify the package dependencies, but a list of packages that should be installed before the package under test. However, it's possible ot use "install_command" to specify a constraints file.
see tox-dev/tox#1939 (comment)

Signed-off-by: Michael Seifert <[email protected]>
The "consider_mro" keyword argument to _pytest.mark.structures.get_unpacked_marks was only introduced in pytest-7.2.0. Removing the explicit argument from the function call will adjust the behavior of pytest-asyncio marks to that of pytest.

Signed-off-by: Michael Seifert <[email protected]>
…unhandled deprecation warnings.

Signed-off-by: Michael Seifert <[email protected]>
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (549950f) 94.08% compared to head (6ffee1c) 94.08%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #660   +/-   ##
=======================================
  Coverage   94.08%   94.08%           
=======================================
  Files           2        2           
  Lines         406      406           
  Branches       87       87           
=======================================
  Hits          382      382           
  Misses         14       14           
  Partials       10       10           
Files Coverage Δ
pytest_asyncio/plugin.py 94.04% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@seifertm seifertm added this pull request to the merge queue Nov 3, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 3, 2023
@seifertm seifertm added this pull request to the merge queue Nov 6, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 6, 2023
@seifertm seifertm added this pull request to the merge queue Nov 8, 2023
Merged via the queue into pytest-dev:main with commit d8b005b Nov 8, 2023
@seifertm seifertm deleted the support-pytest-7.1-and-lower branch November 8, 2023 08:19
@seifertm seifertm restored the support-pytest-7.1-and-lower branch November 8, 2023 12:05
@seifertm seifertm deleted the support-pytest-7.1-and-lower branch November 8, 2023 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get_unpacked_marks() got an unexpected keyword argument 'consider_mro'
3 participants