mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
asyncio: wait_for() now accepts None as timeout (Victor Stinner).
This commit is contained in:
parent
1e9a446ebe
commit
48c66c3dd8
2 changed files with 14 additions and 0 deletions
|
@ -380,6 +380,17 @@ class TaskTests(unittest.TestCase):
|
|||
self.assertEqual(foo_running, False)
|
||||
|
||||
|
||||
def test_wait_for_blocking(self):
|
||||
loop = test_utils.TestLoop()
|
||||
self.addCleanup(loop.close)
|
||||
|
||||
@asyncio.coroutine
|
||||
def coro():
|
||||
return 'done'
|
||||
|
||||
res = loop.run_until_complete(asyncio.wait_for(coro(), timeout=None, loop=loop))
|
||||
self.assertEqual(res, 'done')
|
||||
|
||||
def test_wait_for_with_global_loop(self):
|
||||
|
||||
def gen():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue