diff options
author | Guido van Rossum <guido@python.org> | 2014-01-29 22:30:38 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2014-01-29 22:30:38 (GMT) |
commit | 48c66c3dd82e0f345350f99d0c8713cc1e686939 (patch) | |
tree | 4904cb5bc3c35915d815720f3c7d911c07ecb819 /Lib/test/test_asyncio | |
parent | 1e9a446ebeced921a5da3d9647e96cdd767504a9 (diff) | |
download | cpython-48c66c3dd82e0f345350f99d0c8713cc1e686939.zip cpython-48c66c3dd82e0f345350f99d0c8713cc1e686939.tar.gz cpython-48c66c3dd82e0f345350f99d0c8713cc1e686939.tar.bz2 |
asyncio: wait_for() now accepts None as timeout (Victor Stinner).
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r-- | Lib/test/test_asyncio/test_tasks.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index dbf130c..778b6e0 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -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(): |