Skip to content
Merged
Changes from 1 commit
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
9 changes: 3 additions & 6 deletions Lib/test/test_asyncio/test_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -1122,13 +1122,10 @@ async def inner(httpd):
self.loop.set_exception_handler(lambda loop, ctx: messages.append(ctx))

with test_utils.run_test_server() as httpd:
try:
self.loop.run_until_complete(inner(httpd))
# This exception is caused by `self.loop.stop()` as expected.
except RuntimeError:
pass
finally:
gc.collect()
with self.assertRaises(RuntimeError):
self.loop.run_until_complete(inner(httpd))
gc.collect()

self.assertEqual(messages, [])

Expand Down