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

No virtual modules & No scoped loops for unknown collectors. #747

Merged
merged 2 commits into from
Jan 16, 2024

Conversation

seifertm
Copy link
Contributor

This PR changes the way package-scoped fixtures are registered. Pytest-asyncio no longer creates temporary Python modules (aka "virtual modules") with fixture definitions during collection time. Some setups seem to rely on a fixed list of collected files (see #729 (comment)).

This PR also limits the impact of pytest-asyncio's collection changes for scoped event loops. The plugin no longer tries to install scoped event loops in unknown collector types.

…c package-scoped fixtures.

The temporary files used for this mechanism appearing as disappear after they have been collected. This seems to create issues in some projects, such as setuptools.
see pytest-dev#729 (comment)

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
@seifertm seifertm added this to the v0.23 milestone Jan 14, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jan 14, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (8ba9bd0) 94.78% compared to head (d437496) 94.37%.

Files Patch % Lines
pytest_asyncio/plugin.py 93.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #747      +/-   ##
==========================================
- Coverage   94.78%   94.37%   -0.42%     
==========================================
  Files           2        2              
  Lines         499      480      -19     
  Branches       99       97       -2     
==========================================
- Hits          473      453      -20     
  Misses         19       19              
- Partials        7        8       +1     

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

@seifertm seifertm marked this pull request as ready for review January 14, 2024 19:21
@seifertm
Copy link
Contributor Author

Fixes #729

…lector types.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
@seifertm seifertm added this pull request to the merge queue Jan 16, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 16, 2024
@seifertm seifertm added this pull request to the merge queue Jan 16, 2024
Merged via the queue into pytest-dev:main with commit 463ce98 Jan 16, 2024
14 checks passed
@seifertm seifertm deleted the no-virtual-modules branch January 16, 2024 17:04
@seifertm seifertm restored the no-virtual-modules branch January 28, 2024 18:46
@seifertm seifertm deleted the no-virtual-modules branch January 28, 2024 19:01
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.

None yet

2 participants