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
This warning has started to show up from pytest-asyncio and we are currently suppressing it:
E DeprecationWarning: The event_loop fixture provided by pytest-asyncio has been redefined in
E /home/runner/work/prefect/prefect/tests/conftest.py:211
E Replacing the event_loop fixture with a custom implementation is deprecated
E and will lead to errors in the future.
E If you want to request an asyncio event loop with a scope other than function
E scope, use the "scope" argument to the asyncio mark when marking the tests.
E If you want to return different types of event loops, use the event_loop_policy
E fixture.
The text was updated successfully, but these errors were encountered:
We were blocked from upgrading `pytest` because we were redefining the
`event_loop` fixture, which has been deprecated for some time in
`pytest-asyncio`. Here we remove that fixture and set the appropriate
configuration per their [docs][1]:
* Automatically marks all async tests as being marked with the `asyncio` fixture
set to `loop_scope="session"
* Make the default fixture loop scope `session` as well (in `setup.cfg`)
* In the case where we need to switch to a different policy, like for Windows
support, override the `event_loop_policy` fixture
One issue emerged here, where any test that called `asyncio.run` or `anyio.run`
would leave the test clearing the event loop from the `'MainThread'`, thus
poisoning the environment for all subsequent tests. Adding a fixture that
restores the session-level `pytest-asyncio` event loop after each test function
prevents that issue.
Fixes#14559
[1]: https://pytest-asyncio.readthedocs.io/en/latest/how-to-guides/run_session_tests_in_same_loop.html
This warning has started to show up from
pytest-asyncio
and we are currently suppressing it:The text was updated successfully, but these errors were encountered: