summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_events.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio/test_events.py')
-rw-r--r--Lib/test/test_asyncio/test_events.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
index d7b0a66..ba28e8c 100644
--- a/Lib/test/test_asyncio/test_events.py
+++ b/Lib/test/test_asyncio/test_events.py
@@ -2784,11 +2784,21 @@ class HandleTests(test_utils.TestCase):
coro.cr_running = True
self.assertEqual(coroutines._format_coroutine(coro), 'BBB() running')
+ coro.__name__ = coro.__qualname__ = None
+ self.assertEqual(coroutines._format_coroutine(coro),
+ '<CoroLike without __name__>() running')
+
coro = CoroLike()
+ coro.__qualname__ = 'CoroLike'
# Some coroutines might not have '__name__', such as
# built-in async_gen.asend().
self.assertEqual(coroutines._format_coroutine(coro), 'CoroLike()')
+ coro = CoroLike()
+ coro.__qualname__ = 'AAA'
+ coro.cr_code = None
+ self.assertEqual(coroutines._format_coroutine(coro), 'AAA()')
+
class TimerTests(unittest.TestCase):