From: Yury Selivanov Date: Mon, 1 Jun 2015 01:44:05 +0000 (-0400) Subject: Issue 24017: Add a test for CoroWrapper and 'async def' coroutines X-Git-Tag: v3.5.0b3~122 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e42cc386397746d39c27c2a3b0f6ed95ae17cf24;p=python Issue 24017: Add a test for CoroWrapper and 'async def' coroutines --- diff --git a/Lib/test/test_asyncio/test_pep492.py b/Lib/test/test_asyncio/test_pep492.py index 2f13a51469..aa0e2a2041 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()