https://github.com/python/cpython/commit/b49c68a1b3dfd2c2567c38b2d044c4a1c14a26a7
commit: b49c68a1b3dfd2c2567c38b2d044c4a1c14a26a7
branch: main
author: Thomas Grainger <[email protected]>
committer: kumaraditya303 <[email protected]>
date: 2025-01-03T07:50:24Z
summary:
gh-128404: remove asyncio from test_type_params (#128436)
files:
M Lib/test/test_type_params.py
diff --git a/Lib/test/test_type_params.py b/Lib/test/test_type_params.py
index 89f836cf722966..0f393def827271 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 @@ def generator2[B]():
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 @@ async def coroutine[B]():
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")
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]