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

test that mark.asyncio scope is respected #770

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

minrk
Copy link

@minrk minrk commented Jan 31, 2024

test case for tangential issue discovered trying to provide an example use case for #706.

When a function-scoped async fixture is used, @pytest.mark.asyncio(scope="module") on tests is ignored. Notably, when the function-scoped fixture is used in any test, the scope="module" is ignored. So test_module_loop passes if it is the only test, but if either of the other two tests are enabled, test_module_loop will fail without modification. test_module_loop_function_fixture always fails.

Draft because this only adds a failing test. I don't think I have the expertise to actually fix the behavior, but hopefully the test case can help someone make sure it's fixed.

it is not, if there is a function-scoped fixture included
@seifertm
Copy link
Contributor

Thanks for the example! I haven't looked at it in detail, yet, but it could be related to #868 .

@seifertm seifertm added this to the v0.24 milestone Jul 13, 2024
@seifertm seifertm modified the milestones: v0.24, v1.0 Aug 22, 2024
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.

2 participants