Skip to content

Commit e615633

Browse files
committed
tests: asyncio: collect garbage in run_until_complete_nesting
The test checks that coro1 emits a runtime warning when it is garbage collected. cpython will do this collection immediately, but other implementations such as PyPy might not. Add the appropriate call to support.gc_collect() to ensure the warning is emitted while still in the with statement.
1 parent f8262b8 commit e615633

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Lib/test/test_asyncio/test_events.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ async def coro2():
287287
):
288288
self.assertRaises(
289289
RuntimeError, self.loop.run_until_complete, coro2())
290+
support.gc_collect()
290291

291292
# Note: because of the default Windows timing granularity of
292293
# 15.6 msec, we use fairly long sleep times here (~100 msec).

0 commit comments

Comments
 (0)