diff options
-rw-r--r-- | Lib/test/test_asyncio/test_pep492.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_pep492.py b/Lib/test/test_asyncio/test_pep492.py index 8fc6cba..d123f08 100644 --- a/Lib/test/test_asyncio/test_pep492.py +++ b/Lib/test/test_asyncio/test_pep492.py @@ -106,6 +106,19 @@ class CoroutineTests(BaseTest): self.assertTrue(asyncio.iscoroutine(FakeCoro())) + def test_function_returning_awaitable(self): + class Awaitable: + def __await__(self): + return ('spam',) + + @asyncio.coroutine + def func(): + return Awaitable() + + coro = func() + self.assertEquals(coro.send(None), 'spam') + coro.close() + if __name__ == '__main__': unittest.main() |