From 98ef92002ec289bf8086b0ef3d4f96c2589f4e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Thu, 30 May 2019 18:30:09 +0300 Subject: bpo-36999: Add asyncio.Task.get_coro() (GH-13680) https://bugs.python.org/issue36999 --- Lib/test/test_asyncio/test_tasks.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Lib/test/test_asyncio/test_tasks.py') diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index 114dd76687..74ce25908a 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -2425,6 +2425,16 @@ class BaseTaskTests: self.assertEqual(cvar.get(), -1) + def test_get_coro(self): + loop = asyncio.new_event_loop() + coro = coroutine_function() + try: + task = self.new_task(loop, coro) + loop.run_until_complete(task) + self.assertIs(task.get_coro(), coro) + finally: + loop.close() + def add_subclass_tests(cls): BaseTask = cls.Task -- cgit v1.2.1