summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-07-16 16:50:54 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-07-16 16:50:54 (GMT)
commitf85581f6e58d7a77cfca06a72de1812fcda8e795 (patch)
tree7f62a37e4b15b43580da8c4c4b698b0af9586ea8 /Lib/test
parent845212af414712e7d9c97e17cc9b970e54859869 (diff)
parente931f7b768efd3314a4936d9198f28548179ace6 (diff)
downloadcpython-f85581f6e58d7a77cfca06a72de1812fcda8e795.zip
cpython-f85581f6e58d7a77cfca06a72de1812fcda8e795.tar.gz
cpython-f85581f6e58d7a77cfca06a72de1812fcda8e795.tar.bz2
(Merge 3.4) Issue #21163: Fix "destroy pending task" warning in test_wait_errors()
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_asyncio/test_tasks.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py
index ca770f9..e199c5a 100644
--- a/Lib/test/test_asyncio/test_tasks.py
+++ b/Lib/test/test_asyncio/test_tasks.py
@@ -623,10 +623,13 @@ class TaskTests(test_utils.TestCase):
ValueError, self.loop.run_until_complete,
asyncio.wait(set(), loop=self.loop))
- self.assertRaises(
- ValueError, self.loop.run_until_complete,
- asyncio.wait([asyncio.sleep(10.0, loop=self.loop)],
- return_when=-1, loop=self.loop))
+ # -1 is an invalid return_when value
+ sleep_coro = asyncio.sleep(10.0, loop=self.loop)
+ wait_coro = asyncio.wait([sleep_coro], return_when=-1, loop=self.loop)
+ self.assertRaises(ValueError,
+ self.loop.run_until_complete, wait_coro)
+
+ sleep_coro.close()
def test_wait_first_completed(self):