Skip to content

Commit 5c758d5

Browse files
committed
Fix DeprecationWarning in asyncio tests
1 parent df9f12f commit 5c758d5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/test_asyncio/test_threads.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
import asyncio
44
import unittest
55
import functools
6+
import warnings
67

78
from contextvars import ContextVar
89
from unittest import mock
910

1011

1112
def tearDownModule():
12-
asyncio.set_event_loop_policy(None)
13+
with warnings.catch_warnings():
14+
warnings.simplefilter("ignore", DeprecationWarning)
15+
asyncio.set_event_loop_policy(None)
1316

1417

1518
class ToThreadTests(unittest.IsolatedAsyncioTestCase):

0 commit comments

Comments
 (0)