summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorThomas Grainger <tagrain@gmail.com>2025-01-03 07:50:24 (GMT)
committerGitHub <noreply@github.com>2025-01-03 07:50:24 (GMT)
commitb49c68a1b3dfd2c2567c38b2d044c4a1c14a26a7 (patch)
tree8ed7c405bd8c9acd907f77fb341b398028ba8dab /Lib
parente7adeecc2b318505eb53bc779320f028be40cccc (diff)
downloadcpython-b49c68a1b3dfd2c2567c38b2d044c4a1c14a26a7.zip
cpython-b49c68a1b3dfd2c2567c38b2d044c4a1c14a26a7.tar.gz
cpython-b49c68a1b3dfd2c2567c38b2d044c4a1c14a26a7.tar.bz2
gh-128404: remove asyncio from test_type_params (#128436)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_type_params.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/Lib/test/test_type_params.py b/Lib/test/test_type_params.py
index 89f836c..0f393de 100644
--- a/Lib/test/test_type_params.py
+++ b/Lib/test/test_type_params.py
@@ -1,11 +1,10 @@
import annotationlib
-import asyncio
import textwrap
import types
import unittest
import pickle
import weakref
-from test.support import requires_working_socket, check_syntax_error, run_code
+from test.support import check_syntax_error, run_code, run_no_yield_async_fn
from typing import Generic, NoDefault, Sequence, TypeAliasType, TypeVar, TypeVarTuple, ParamSpec, get_args
@@ -1051,7 +1050,6 @@ class TypeParamsTypeVarTest(unittest.TestCase):
self.assertIsInstance(c, TypeVar)
self.assertEqual(c.__name__, "C")
- @requires_working_socket()
def test_typevar_coroutine(self):
def get_coroutine[A]():
async def coroutine[B]():
@@ -1060,8 +1058,7 @@ class TypeParamsTypeVarTest(unittest.TestCase):
co = get_coroutine()
- self.addCleanup(asyncio._set_event_loop_policy, None)
- a, b = asyncio.run(co())
+ a, b = run_no_yield_async_fn(co)
self.assertIsInstance(a, TypeVar)
self.assertEqual(a.__name__, "A")