summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-06-01 01:44:05 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-06-01 01:44:05 (GMT)
commite42cc386397746d39c27c2a3b0f6ed95ae17cf24 (patch)
treef7619a104184ff1542a54509e07cb65f1129480e /Lib/test
parent6a0fab92f96afcdbf62c0fb5f80f5b420e43cc49 (diff)
downloadcpython-e42cc386397746d39c27c2a3b0f6ed95ae17cf24.zip
cpython-e42cc386397746d39c27c2a3b0f6ed95ae17cf24.tar.gz
cpython-e42cc386397746d39c27c2a3b0f6ed95ae17cf24.tar.bz2
Issue 24017: Add a test for CoroWrapper and 'async def' coroutines
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_asyncio/test_pep492.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_pep492.py b/Lib/test/test_asyncio/test_pep492.py
index 2f13a51..aa0e2a2 100644
--- 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():
+ return 'spam'
+ async def foo():
+ return await bar()
+
+ # production mode
+ data = self.loop.run_until_complete(foo())
+ self.assertEqual(data, 'spam')
+
+ # debug mode
+ self.loop.set_debug(True)
+ data = self.loop.run_until_complete(foo())
+ self.assertEqual(data, 'spam')
if __name__ == '__main__':
unittest.main()