summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-09-01 22:25:39 (GMT)
committerGitHub <noreply@github.com>2017-09-01 22:25:39 (GMT)
commite8a533fbc734af6eeb389202ba6c6e9c2548027f (patch)
tree20d58f8741ff227b6c130308d9a666ccc60c3fba /Lib
parentb713adf27a76b5df95e3ee5f85f9064a2763ae35 (diff)
downloadcpython-e8a533fbc734af6eeb389202ba6c6e9c2548027f.zip
cpython-e8a533fbc734af6eeb389202ba6c6e9c2548027f.tar.gz
cpython-e8a533fbc734af6eeb389202ba6c6e9c2548027f.tar.bz2
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().
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_asyncio/test_events.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
index 9746678..27781a2 100644
--- a/Lib/test/test_asyncio/test_events.py
+++ b/Lib/test/test_asyncio/test_events.py
@@ -258,8 +258,8 @@ class EventLoopTestsMixin:
if not self.loop.is_closed():
test_utils.run_briefly(self.loop)
- self.loop.close()
- gc.collect()
+ self.doCleanups()
+ support.gc_collect()
super().tearDown()
def test_run_until_complete_nesting(self):