pytest-asyncio
pytest-asyncio copied to clipboard
test that mark.asyncio scope is respected
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.
Thanks for the example! I haven't looked at it in detail, yet, but it could be related to #868 .