bpo-31250, test_asyncio: fix EventLoopTestsMixin.tearDown() (#3264) · python/cpython@e8a533f (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Commit e8a533f

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().

File tree

1 file changed

lines changed

1 file changed

lines changed

Original file line number Diff line number Diff line change
@@ -258,8 +258,8 @@ def tearDown(self):
258 258 if not self.loop.is_closed():
259 259 test_utils.run_briefly(self.loop)
260 260
261 -self.loop.close()
262 -gc.collect()
261 +self.doCleanups()
262 +support.gc_collect()
263 263 super().tearDown()
264 264
265 265 def test_run_until_complete_nesting(self):