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 18964af

Browse filesBrowse files
committed
use self.assertRaises instead
1 parent 8cd70ee commit 18964af
Copy full SHA for 18964af

File tree

Expand file treeCollapse file tree

1 file changed

+3
-6
lines changed
Filter options
Expand file treeCollapse file tree

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:
1126-
self.loop.run_until_complete(inner(httpd))
11271125
# This exception is caused by `self.loop.stop()` as expected.
1128-
except RuntimeError:
1129-
pass
1130-
finally:
1131-
gc.collect()
1126+
with self.assertRaises(RuntimeError):
1127+
self.loop.run_until_complete(inner(httpd))
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.