We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
test_loop_is_closed_resource_warnings
1 parent 2bcc0f7 commit 18c6929Copy full SHA for 18c6929
Lib/test/test_asyncio/test_streams.py
@@ -1122,13 +1122,10 @@ async def inner(httpd):
1122
self.loop.set_exception_handler(lambda loop, ctx: messages.append(ctx))
1123
1124
with test_utils.run_test_server() as httpd:
1125
- try:
+ with self.assertRaises(RuntimeError):
1126
+ # This exception is caused by `self.loop.stop()` as expected.
1127
self.loop.run_until_complete(inner(httpd))
- # This exception is caused by `self.loop.stop()` as expected.
1128
- except RuntimeError:
1129
- pass
1130
- finally:
1131
- gc.collect()
+ gc.collect()
1132
1133
self.assertEqual(messages, [])
1134
0 commit comments