Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 18c6929

Browse filesBrowse files
authored
gh-112186: Improve test case test_loop_is_closed_resource_warnings (#112187)
1 parent 2bcc0f7 commit 18c6929
Copy full SHA for 18c6929

File tree

1 file changed

+3
-6
lines changed
Filter options

1 file changed

+3
-6
lines changed

‎Lib/test/test_asyncio/test_streams.py

Copy file name to clipboardExpand all lines: Lib/test/test_asyncio/test_streams.py
+3-6Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,13 +1122,10 @@ async def inner(httpd):
11221122
self.loop.set_exception_handler(lambda loop, ctx: messages.append(ctx))
11231123

11241124
with test_utils.run_test_server() as httpd:
1125-
try:
1125+
with self.assertRaises(RuntimeError):
1126+
# This exception is caused by `self.loop.stop()` as expected.
11261127
self.loop.run_until_complete(inner(httpd))
1127-
# This exception is caused by `self.loop.stop()` as expected.
1128-
except RuntimeError:
1129-
pass
1130-
finally:
1131-
gc.collect()
1128+
gc.collect()
11321129

11331130
self.assertEqual(messages, [])
11341131

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.