diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-12-11 16:34:11 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-12-11 16:34:11 (GMT) |
commit | d3ded40a53df40c5dd9c1fd05c886bfe91df4aee (patch) | |
tree | c1a8a40091c0dbde19fc418b19689f10282fe0ad /Lib/test | |
parent | 7888e6702776c0e619fbf10857534fc18b0d1a1a (diff) | |
parent | 0ac3a0cd7932079724aaabbb0a078e1c17129068 (diff) | |
download | cpython-d3ded40a53df40c5dd9c1fd05c886bfe91df4aee.zip cpython-d3ded40a53df40c5dd9c1fd05c886bfe91df4aee.tar.gz cpython-d3ded40a53df40c5dd9c1fd05c886bfe91df4aee.tar.bz2 |
Merge 3.4
Diffstat (limited to 'Lib/test')
-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 04d19ac..47b17d1 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -76,6 +76,21 @@ class TaskTests(test_utils.TestCase): def setUp(self): self.loop = self.new_test_loop() + def test_other_loop_future(self): + other_loop = asyncio.new_event_loop() + fut = asyncio.Future(loop=other_loop) + + @asyncio.coroutine + def run(fut): + yield from fut + + try: + with self.assertRaisesRegex(RuntimeError, + r'Task .* got Future .* attached'): + self.loop.run_until_complete(run(fut)) + finally: + other_loop.close() + def test_task_class(self): @asyncio.coroutine def notmuch(): |