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

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


https://hg.python.org/cpython/rev/95edcac4b1c2
changeset:   96660:95edcac4b1c2
parent:      96657:2e4d604c449d
parent:      96659:5863499d48e5
user:        Yury Selivanov <yselivanov at sprymix.com>
date:        Wed Jun 24 10:48:20 2015 -0400
summary:
  Fix asyncio unittests in debug mode (Merge 3.5)

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