Fix asyncio unittests in debug mode

This commit is contained in:
Yury Selivanov 2015-06-24 10:47:44 -04:00
commit 5ac716251f
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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)):