Skip to content

gh-128404: remove asyncio from test_type_params #128436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions Lib/test/test_type_params.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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]():
Expand All @@ -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")
Expand Down
Loading