diff options
author | Alexander Mohr <thehesiod@users.noreply.github.com> | 2017-08-02 06:31:07 (GMT) |
---|---|---|
committer | INADA Naoki <methane@users.noreply.github.com> | 2017-08-02 06:31:07 (GMT) |
commit | de34cbe9cdaaf7b85fed86f99c2fd071e1a7b1d2 (patch) | |
tree | 12fc6ed6dc8e1e23fd75d6b35c29dda2b8469cea /Lib/test/test_asyncio/test_tasks.py | |
parent | 47320a652e872003f3dd3a9db4243067b09dd316 (diff) | |
download | cpython-de34cbe9cdaaf7b85fed86f99c2fd071e1a7b1d2.zip cpython-de34cbe9cdaaf7b85fed86f99c2fd071e1a7b1d2.tar.gz cpython-de34cbe9cdaaf7b85fed86f99c2fd071e1a7b1d2.tar.bz2 |
bpo-31061: fix crash in asyncio speedup module (GH-2966)
Diffstat (limited to 'Lib/test/test_asyncio/test_tasks.py')
-rw-r--r-- | Lib/test/test_asyncio/test_tasks.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index 686387f..36082ec 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -3,6 +3,7 @@ import collections import contextlib import functools +import gc import io import os import re @@ -91,6 +92,20 @@ class BaseTaskTests: self.loop.set_task_factory(self.new_task) self.loop.create_future = lambda: self.new_future(self.loop) + def test_task_del_collect(self): + class Evil: + def __del__(self): + gc.collect() + + @asyncio.coroutine + def run(): + return Evil() + + self.loop.run_until_complete( + asyncio.gather(*[ + self.new_task(self.loop, run()) for _ in range(100) + ], loop=self.loop)) + def test_other_loop_future(self): other_loop = asyncio.new_event_loop() fut = self.new_future(other_loop) |