cpython: a0a699b828e7 (original) (raw)
Mercurial > cpython
changeset 96440:a0a699b828e7 3.5
Issue 24017: Add a test for CoroWrapper and 'async def' coroutines
Yury Selivanov yselivanov@sprymix.com | |
---|---|
date | Sun, 31 May 2015 21:44:05 -0400 |
parents | 1dc232783012 |
children | 89521ac669f0 5969972458c7 |
files | Lib/test/test_asyncio/test_pep492.py |
diffstat | 1 files changed, 14 insertions(+), 0 deletions(-)[+] [-] Lib/test/test_asyncio/test_pep492.py 14 |
line wrap: on
line diff
--- a/Lib/test/test_asyncio/test_pep492.py +++ b/Lib/test/test_asyncio/test_pep492.py @@ -119,6 +119,20 @@ class CoroutineTests(BaseTest): self.assertEqual(coro.send(None), 'spam') coro.close()
- def test_async_ded_coroutines(self):
async def bar():[](#l1.8)
return 'spam'[](#l1.9)
async def foo():[](#l1.10)
return await bar()[](#l1.11)
# production mode[](#l1.13)
data = self.loop.run_until_complete(foo())[](#l1.14)
self.assertEqual(data, 'spam')[](#l1.15)
# debug mode[](#l1.17)
self.loop.set_debug(True)[](#l1.18)
data = self.loop.run_until_complete(foo())[](#l1.19)
self.assertEqual(data, 'spam')[](#l1.20)