Commit 2751982
refactor: Replaced tests asserting that the event loop is properly closed.
Under Python 3.10, the tests raise:
"DeprecationWarning: There is no current event loop"
This means that the asyncio.get_event_loop does not return any existing loop. It creates a new loop as a side effect instead. Therefore, test_1 and test_3 will always be successful.
However, it would be wrong to simply delete the tests without a replacement. Although, we cannot retrieve the default loop with get_event_loop, we can still retrieve it from the event loop policy. The new tests do exactly that and assert that the loop is a different object than in the tests before.
Signed-off-by: Michael Seifert <[email protected]>1 parent 70989fd commit 2751982
1 file changed
+15
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | | - | |
12 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
17 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
18 | 25 | | |
19 | 26 | | |
20 | 27 | | |
21 | | - | |
22 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
0 commit comments