[Python-checkins] cpython (3.4): asyncio: Fix two "Coroutine xxx was never yielded from" messages in tests

victor.stinner python-checkins at python.org
Sat Jun 28 01:20:34 CEST 2014


http://hg.python.org/cpython/rev/39019673aa8d
changeset:   91454:39019673aa8d
branch:      3.4
parent:      91452:26287c059304
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Sat Jun 28 01:19:11 2014 +0200
summary:
  asyncio: Fix two "Coroutine xxx was never yielded from" messages in tests

files:
  Lib/test/test_asyncio/test_tasks.py |  8 ++++++--
  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
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -1423,8 +1423,10 @@
         # 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 @@
         # 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,

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list