Set default asyncio fixture loop scope to function#1444
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1444 +/- ##
==========================================
+ Coverage 94.50% 94.87% +0.36%
==========================================
Files 2 2
Lines 510 507 -3
Branches 62 61 -1
==========================================
- Hits 482 481 -1
+ Misses 22 21 -1
+ Partials 6 5 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
seifertm
left a comment
There was a problem hiding this comment.
Thanks for the initiative, @SahilArchitect .
This is a breaking change that requires a major version bump. The next version will be v1.4.0, so I won't merge the PR just yet. In the meantime, could you have a look at my comments?
There was a problem hiding this comment.
The news fragment describes a change of a warning message. Your change is unrelated to this news fragment and will be included in a different release. Please remove any modifications to this file.
There was a problem hiding this comment.
This is the migration guide for users looking to upgrade from an older version of pytest-asyncio. This patch doesn't change anything in the upgrade path. Please remove any modifications to this file.
|
Thanks for the review. I pushed a follow-up commit now. What I changed:
For the test: I changed it to use a I also reran: Both passed. |
Closes #924.
Summary
Sets the default value of
asyncio_default_fixture_loop_scopetofunctionand removes the deprecated unsetfallback/warning path.
This intentionally only changes the default for async fixture loop scope. It does not change async test loop scope
behavior, custom
event_loopfixture deprecations, pytest warning filtering order, or quotedpytest.inivalueparsing.
Changes
asyncio_default_fixture_loop_scopetofunctionTests
python -m pytest tests/test_fixture_loop_scopes.pypython -m pytest tests/test_asyncio_fixture.py tests/modes/test_auto_mode.py tests/modes/test_strict_mode.py