mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
(Merge 3.4) Issue #21163: Fix "destroy pending task" warning in test_wait_errors()
This commit is contained in:
commit
f85581f6e5
2 changed files with 9 additions and 6 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue