[Python-checkins] cpython (merge 3.4 -> 3.5): Fix asyncio unittests in debug mode

yury.selivanov python-checkins at python.org
Wed Jun 24 16:48:40 CEST 2015


https://hg.python.org/cpython/rev/5863499d48e5
changeset: 96659:5863499d48e5
branch: 3.5
parent: 96656:338597d2e93b
parent: 96658:91846e5669e3
user: Yury Selivanov <yselivanov at sprymix.com>
date: Wed Jun 24 10:47:44 2015 -0400
summary:
 Fix asyncio unittests in debug mode
files:
 Lib/asyncio/coroutines.py | 2 ++
 Lib/test/test_asyncio/test_pep492.py | 2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/Lib/asyncio/coroutines.py b/Lib/asyncio/coroutines.py
--- a/Lib/asyncio/coroutines.py
+++ b/Lib/asyncio/coroutines.py
@@ -252,6 +252,8 @@
 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
--- a/Lib/test/test_asyncio/test_pep492.py
+++ b/Lib/test/test_asyncio/test_pep492.py
@@ -142,7 +142,7 @@
 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)):
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /