Skip to content

Commit 04bd65e

Browse files
committed
Fix test_run_until_complete_loop_orphan_future_close_loop
1 parent 47e064f commit 04bd65e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Lib/test/test_asyncio/test_base_events.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ def test_run_until_complete_loop(self):
476476
other_loop.run_until_complete, task)
477477

478478
def test_run_until_complete_loop_orphan_future_close_loop(self):
479-
class ShowStopper(BaseException):
479+
class ShowStopper(SystemExit):
480480
pass
481481

482482
async def foo(delay):
@@ -487,10 +487,8 @@ def throw():
487487

488488
self.loop._process_events = mock.Mock()
489489
self.loop.call_soon(throw)
490-
try:
490+
with self.assertRaises(ShowStopper):
491491
self.loop.run_until_complete(foo(0.1))
492-
except ShowStopper:
493-
pass
494492

495493
# This call fails if run_until_complete does not clean up
496494
# done-callback for the previous future.

0 commit comments

Comments
 (0)