summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-06-27 23:19:11 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-06-27 23:19:11 (GMT)
commit09e7590801d6d18668afa7327069fc3002f0249d (patch)
tree9bc6c17683d32b306eb2861108ac5874554035ff /Lib/test/test_asyncio
parentb9a301a348f8867f1b8adebd2e6a4d728889f66b (diff)
downloadcpython-09e7590801d6d18668afa7327069fc3002f0249d.zip
cpython-09e7590801d6d18668afa7327069fc3002f0249d.tar.gz
cpython-09e7590801d6d18668afa7327069fc3002f0249d.tar.bz2
asyncio: Fix two "Coroutine xxx was never yielded from" messages in tests
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r--Lib/test/test_asyncio/test_tasks.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
index dee14b2..b4a3092 100644
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -1423,8 +1423,10 @@ class TaskTests(test_utils.TestCase):
# as_completed() expects a list of futures, not a future instance
self.assertRaises(TypeError, self.loop.run_until_complete,
asyncio.as_completed(fut, loop=self.loop))
+ coro = coroutine_function()
self.assertRaises(TypeError, self.loop.run_until_complete,
- asyncio.as_completed(coroutine_function(), loop=self.loop))
+ asyncio.as_completed(coro, loop=self.loop))
+ coro.close()
def test_wait_invalid_args(self):
fut = asyncio.Future(loop=self.loop)
@@ -1432,8 +1434,10 @@ class TaskTests(test_utils.TestCase):
# wait() expects a list of futures, not a future instance
self.assertRaises(TypeError, self.loop.run_until_complete,
asyncio.wait(fut, loop=self.loop))
+ coro = coroutine_function()
self.assertRaises(TypeError, self.loop.run_until_complete,
- asyncio.wait(coroutine_function(), loop=self.loop))
+ asyncio.wait(coro, loop=self.loop))
+ coro.close()
# wait() expects at least a future
self.assertRaises(ValueError, self.loop.run_until_complete,