Skip to content

gh-129354: Cleanup test_coroutines #129684

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 1 commit into from
Feb 5, 2025
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: 3 additions & 4 deletions Lib/test/test_coroutines.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ async def func(): pass

def test_func_12(self):
async def g():
i = me.send(None)
me.send(None)
await foo
me = g()
with self.assertRaisesRegex(ValueError,
Expand Down Expand Up @@ -2283,7 +2283,7 @@ async def __aexit__(self, exc_type, exc_val, exc_tb):
buffer.append(exc_type.__name__)

async def f():
async with CM() as c:
async with CM():
await asyncio.sleep(0.01)
raise MyException
buffer.append('unreachable')
Expand Down Expand Up @@ -2375,7 +2375,7 @@ def check(depth, msg):

orig_depth = sys.get_coroutine_origin_tracking_depth()
try:
msg = check(0, f"coroutine '{corofn.__qualname__}' was never awaited")
check(0, f"coroutine '{corofn.__qualname__}' was never awaited")
check(1, "".join([
f"coroutine '{corofn.__qualname__}' was never awaited\n",
"Coroutine created at (most recent call last)\n",
Expand Down Expand Up @@ -2413,7 +2413,6 @@ async def corofn():
coro_repr = repr(coro)

# clear reference to the coroutine without awaiting for it
coro_repr = repr(coro)
del coro
support.gc_collect()

Expand Down
Loading