Skip to content

Commit b49c68a

Browse files
authored
gh-128404: remove asyncio from test_type_params (#128436)
1 parent e7adeec commit b49c68a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Lib/test/test_type_params.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import annotationlib
2-
import asyncio
32
import textwrap
43
import types
54
import unittest
65
import pickle
76
import weakref
8-
from test.support import requires_working_socket, check_syntax_error, run_code
7+
from test.support import check_syntax_error, run_code, run_no_yield_async_fn
98

109
from typing import Generic, NoDefault, Sequence, TypeAliasType, TypeVar, TypeVarTuple, ParamSpec, get_args
1110

@@ -1051,7 +1050,6 @@ def generator2[B]():
10511050
self.assertIsInstance(c, TypeVar)
10521051
self.assertEqual(c.__name__, "C")
10531052

1054-
@requires_working_socket()
10551053
def test_typevar_coroutine(self):
10561054
def get_coroutine[A]():
10571055
async def coroutine[B]():
@@ -1060,8 +1058,7 @@ async def coroutine[B]():
10601058

10611059
co = get_coroutine()
10621060

1063-
self.addCleanup(asyncio._set_event_loop_policy, None)
1064-
a, b = asyncio.run(co())
1061+
a, b = run_no_yield_async_fn(co)
10651062

10661063
self.assertIsInstance(a, TypeVar)
10671064
self.assertEqual(a.__name__, "A")

0 commit comments

Comments
 (0)