You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Contrary to the statements in the documentation (here and here), the fixture is not only applied to all pytest-asyncio tests, but also applied to all other tests.
The event loop policy fixture is defined as an autouse fixture. I don't exactly recall why, but I think the reason is that it's now used by the deprecated event_loop fixture and had to be marked as autouse for backwards compatibility.
It's obviously a bug that this also parametrizes all sync tests and needs to be addressed.
However, I don't expect this issue to be fixed before v1.0 when the legacy event_loop fixture is gone.
Note that you must parametrize your async tests by policy in some way, otherwise you will get The requested fixture has no parameter defined for test. This is because event_loop is requested using request.getfixturevalue, so pytest doesn't know that it should create two runs of test_async, and when event_loop is requested it is too late. In my case I was already requesting policy in all my tests anyway, but this may be more annoying for you.
Contrary to the statements in the documentation (here and here), the fixture is not only applied to all pytest-asyncio tests, but also applied to all other tests.
Output:
The text was updated successfully, but these errors were encountered: