-
Notifications
You must be signed in to change notification settings - Fork 160
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
feat: Configuration option for setting default loop_scope for tests #1035
base: main
Are you sure you want to change the base?
feat: Configuration option for setting default loop_scope for tests #1035
Conversation
cb06135
to
5272cc4
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1035 +/- ##
==========================================
+ Coverage 91.13% 91.27% +0.13%
==========================================
Files 2 2
Lines 564 573 +9
Branches 74 75 +1
==========================================
+ Hits 514 523 +9
Misses 30 30
Partials 20 20 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I really like how you changed _get_marked_loop_scope and how you used functions to keep the code readable.
Can you please add an entry to docs/reference/changelog.rst where you link to #793 ?
Assume that this PR bumps the minor version and set the date to UNRELEASED.
@@ -0,0 +1,24 @@ | |||
======================================================= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's nothing short of great that you even included a how-to guide for the new approach, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a bit of copy-paste ;)
@@ -9,6 +9,7 @@ How-To Guides | |||
migrate_from_0_23 | |||
change_fixture_loop | |||
change_default_fixture_loop | |||
change_default_test_loop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can drop the "run_session_tests_in_same_loop" how-to guide. It's superseded by the configuration option. I cannot think of a use case where someone wants to use the pytest hook, instead of the config option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How-to removed
787a67d
to
aa2339d
Compare
New configuration option, asyncio_default_test_loop_scope, provides default value for loop_scope argument of asyncio marker. This can be used to use the same event loop in auto mode without need to use modifyitems hook. Test functions can still override loop_scope by using asyncio marker.
aa2339d
to
6c3a941
Compare
Thanks for kind words. I've rebased this branch and applied modifications you requested. |
New configuration option,
asyncio_default_test_loop_scope
, provides default value for loop_scope argument ofasyncio
marker. This can be used to use the same event loop in auto mode without need to usemodifyitems
hook.Test functions can still override
loop_scope
by usingasyncio
marker.Implements #793