summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-06-24 14:47:44 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-06-24 14:47:44 (GMT)
commit5ac716251f9ad96120b70319fcc6be67aa383a6b (patch)
tree2b447e7700fcd9daf6768a9d76344930b346172a
parent8f1c99321bfe72d21b01bad71293a7daa1c9e73f (diff)
parent339d5e7d85e6d56e90943ca8940a7e7d0f3f1f6a (diff)
downloadcpython-5ac716251f9ad96120b70319fcc6be67aa383a6b.zip
cpython-5ac716251f9ad96120b70319fcc6be67aa383a6b.tar.gz
cpython-5ac716251f9ad96120b70319fcc6be67aa383a6b.tar.bz2
Fix asyncio unittests in debug mode
-rw-r--r--Lib/asyncio/coroutines.py2
-rw-r--r--Lib/test/test_asyncio/test_pep492.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/Lib/asyncio/coroutines.py b/Lib/asyncio/coroutines.py
index 896cc56..a70eb1d 100644
--- a/Lib/asyncio/coroutines.py
+++ b/Lib/asyncio/coroutines.py
@@ -252,6 +252,8 @@ def _format_coroutine(coro):
if isinstance(coro, CoroWrapper):
func = coro.func
coro_name = coro.__qualname__
+ if coro_name is not None:
+ coro_name = '{}()'.format(coro_name)
else:
func = coro
diff --git a/Lib/test/test_asyncio/test_pep492.py b/Lib/test/test_asyncio/test_pep492.py
index 82bb995..c7d5f21 100644
--- a/Lib/test/test_asyncio/test_pep492.py
+++ b/Lib/test/test_asyncio/test_pep492.py
@@ -142,7 +142,7 @@ class CoroutineTests(BaseTest):
foo_coro = foo()
self.assertRegex(
repr(foo_coro),
- r'<CoroWrapper .*\.foo running at .*pep492.*>')
+ r'<CoroWrapper .*\.foo\(\) running at .*pep492.*>')
with support.check_warnings((r'.*foo.*was never',
RuntimeWarning)):