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

Avoid errors in cleanup when event loop is already closed #1051

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

minrk
Copy link
Contributor

@minrk minrk commented Jan 27, 2025

check is_closed() before calling cleanup methods and catch errors in cleanup to avoid problems

closes #1040

@codecov-commenter
Copy link

codecov-commenter commented Jan 27, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 90.84%. Comparing base (92b006f) to head (1099d3f).

Files with missing lines Patch % Lines
pytest_asyncio/plugin.py 50.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1051      +/-   ##
==========================================
- Coverage   91.31%   90.84%   -0.48%     
==========================================
  Files           2        2              
  Lines         576      579       +3     
  Branches       76       77       +1     
==========================================
  Hits          526      526              
- Misses         30       32       +2     
- Partials       20       21       +1     

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

@minrk
Copy link
Contributor Author

minrk commented Jan 27, 2025

Not sure why codecov misreports coverage. A local run shows the missed lines are actually covered by 8bc0e19

minrk added 2 commits January 28, 2025 19:16
…lready closed

check `is_closed()` before calling cleanup methods
and degrade exceptions to warnings during cleanup to avoid problems
Copy link
Contributor

@seifertm seifertm left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the bug fix!

I agree that downgrading exceptions during cleanup to a warning makes sense, as outlined in my comment on the bug report.

I took the liberty to modify the changelog commit history for easier cherry-picking into the v0.25 release branch. I think we should do a separate bugfix release for v0.25, rather than adding this to the v0.26 release.

@seifertm seifertm added this pull request to the merge queue Jan 28, 2025
Merged via the queue into pytest-dev:main with commit 6da8c87 Jan 28, 2025
15 checks passed
@seifertm seifertm added this to the v0.25 milestone Jan 28, 2025
@minrk
Copy link
Contributor Author

minrk commented Jan 28, 2025

Thanks!

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.

Regression in 0.25.2 - Event loop is closed
3 participants