Skip to content

Commit e8a533f

Browse files
authored
bpo-31250, test_asyncio: fix EventLoopTestsMixin.tearDown() (#3264)
Call doCleanups() to close the loop after calling executor.shutdown(wait=True): see TestCase.set_event_loop() of asyncio.test_utils. Replace also gc.collect() with support.gc_collect().
1 parent b713adf commit e8a533f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/test_asyncio/test_events.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ def tearDown(self):
258258
if not self.loop.is_closed():
259259
test_utils.run_briefly(self.loop)
260260

261-
self.loop.close()
262-
gc.collect()
261+
self.doCleanups()
262+
support.gc_collect()
263263
super().tearDown()
264264

265265
def test_run_until_complete_nesting(self):

0 commit comments

Comments
 (0)