-
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
Configuration option for default loop scope #793
Comments
0.24 adds essentially this option for fixtures in |
Do you know if someone is working on this configuration option? If not, I think I can spend some time on it and make a PR. By looking at the code, it seems to me that default value from configuration option shall be applied in (or around calls to) |
I'm not ware that anyone is currently working on this. If you can contribute a PR, that's great! Your idea sounds good. You somehow need to access Config, in order to get the configured value. This should be possible from both call sites, where Item and Metafunc are available, respectively. Pytest-asyncio isn't particularly easy to hack on, so let me know if you get stuck! |
When a user wants to run all tests in a session-scoped event loop, the documentation suggests implementing a pytest_collection_modifyitems hook.
In auto mode the hook causes duplicate asyncio markers to be attached to test items. This is a cosmetic issue, but creates additional noise when debugging item markers.
In strict mode the behavior of the hook rules out manual overrides of the asyncio mark.
A configuration option for the default loop scope as suggested in #705 (comment) would eliminate duplicate asyncio markers in auto mode and allow overriding the default loop scope with explicit markers in strict mode.
The text was updated successfully, but these errors were encountered: