Commit 007e8ec
authored
[fix] Prevent DeprecationWarning about existing event loops to bubble up into user code. (#461)
Pytest-asyncio fixture setup currently uses `get_event_loop` to clean up loops that don't correspond to the loop returned by the `event_loop` fixture. Starting with CPython 3.10.9 and 3.11.1 the call to get_event_loop emits a DeprecationWarning when function is called, but no event loop exists. This warning bubbles up and shows in test runs of library users. If the users have enabled `-W error` their tests will fail due to a warning in pytest-asyncio.
This patch ignores the DeprecationWarning in the fixture setup. This is a temporary solution to restore compatibility with the respective CPython patch releases.
Addresses #460
Signed-off-by: Michael Seifert <[email protected]>
Signed-off-by: Michael Seifert <[email protected]>1 parent 44ca3da commit 007e8ec
2 files changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
402 | | - | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
403 | 405 | | |
404 | 406 | | |
405 | 407 | | |
| |||
0 commit comments