summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_tasks.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-06-25 21:33:02 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-06-25 21:33:02 (GMT)
commit86ceffc3efd33ea9af54276c7a2b4b0729955c22 (patch)
tree79ecfa1971c64d0e890da5575eb9564c31de080e /Lib/test/test_asyncio/test_tasks.py
parent16b3c99141232a6b86c0fc47508d582cdd726005 (diff)
parent7ba40610983f016b9c863523e7252f873a52abca (diff)
downloadcpython-86ceffc3efd33ea9af54276c7a2b4b0729955c22.zip
cpython-86ceffc3efd33ea9af54276c7a2b4b0729955c22.tar.gz
cpython-86ceffc3efd33ea9af54276c7a2b4b0729955c22.tar.bz2
(Merge 3.4) asyncio: sync with Tulip
- Python issue 21163: Fix more "Task was destroyed but it is pending!" logs in tests - Add test to check that run_until_complete() checks the loop of the future
Diffstat (limited to 'Lib/test/test_asyncio/test_tasks.py')
-rw-r--r--Lib/test/test_asyncio/test_tasks.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
index 3a23d72..4508987 100644
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -51,6 +51,7 @@ class TaskTests(test_utils.TestCase):
self.set_event_loop(loop)
t = asyncio.Task(notmuch(), loop=loop)
self.assertIs(t._loop, loop)
+ loop.run_until_complete(t)
loop.close()
def test_async_coroutine(self):
@@ -67,6 +68,7 @@ class TaskTests(test_utils.TestCase):
self.set_event_loop(loop)
t = asyncio.async(notmuch(), loop=loop)
self.assertIs(t._loop, loop)
+ loop.run_until_complete(t)
loop.close()
def test_async_future(self):
@@ -213,6 +215,7 @@ class TaskTests(test_utils.TestCase):
t.add_done_callback(Dummy())
self.assertEqual(repr(t),
'<Task pending %s cb=[<Dummy>()]>' % coro)
+ self.loop.run_until_complete(t)
def test_task_basics(self):
@asyncio.coroutine