Skip to content

Commit e55fc84

Browse files
committed
fix DeprecationWarning in test_inspect.py
1 parent 30efede commit e55fc84

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

Lib/test/test_inspect/test_inspect.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from annotationlib import Format, ForwardRef
2-
import asyncio
32
import builtins
43
import collections
54
import copy
@@ -73,11 +72,6 @@ def revise(filename, *args):
7372
git = mod.StupidGit()
7473

7574

76-
def tearDownModule():
77-
if support.has_socket_support:
78-
asyncio._set_event_loop_policy(None)
79-
80-
8175
def signatures_with_lexicographic_keyword_only_parameters():
8276
"""
8377
Yields a whole bunch of functions with only keyword-only parameters,
@@ -1172,10 +1166,9 @@ def f(self):
11721166
)
11731167
def test_nested_class_definition_inside_async_function(self):
11741168
import asyncio
1175-
self.addCleanup(asyncio.set_event_loop_policy, None)
1176-
self.assertSourceEqual(asyncio.run(mod2.func225()), 226, 227)
1169+
self.assertSourceEqual(asyncio.run(mod2.func225(), loop_factory=asyncio.EventLoop), 226, 227)
11771170
self.assertSourceEqual(mod2.cls226, 231, 235)
1178-
self.assertSourceEqual(asyncio.run(mod2.cls226().func232()), 233, 234)
1171+
self.assertSourceEqual(asyncio.run(mod2.cls226().func232(), loop_factory=asyncio.EventLoop), 233, 234)
11791172

11801173
def test_class_definition_same_name_diff_methods(self):
11811174
self.assertSourceEqual(mod2.cls296, 296, 298)

0 commit comments

Comments
 (0)