Skip to content
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
8 changes: 5 additions & 3 deletions Lib/test/test_asyncgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1057,8 +1057,7 @@ async def gen():
while True:
yield 1
finally:
await asyncio.sleep(0.01)
await asyncio.sleep(0.01)
await asyncio.sleep(0)
DONE = 1

async def run():
Expand All @@ -1068,7 +1067,10 @@ async def run():
del g
gc_collect() # For PyPy or other GCs.

await asyncio.sleep(0.1)
# Starts running the aclose task
await asyncio.sleep(0)
# For asyncio.sleep(0) in finally block
await asyncio.sleep(0)

self.loop.run_until_complete(run())
self.assertEqual(DONE, 1)
Expand Down