mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
asyncio: sync with Tulip
* Tulip issue #182: Improve logs of BaseEventLoop._run_once() - Don't log non-blocking poll - Only log polling with a timeout if it gets events or if it timed out after more than 1 second. * Fix some pyflakes warnings: remove unused imports
This commit is contained in:
parent
3740d589f7
commit
770e48d017
6 changed files with 20 additions and 16 deletions
|
@ -1,6 +1,5 @@
|
|||
"""Tests for tasks.py."""
|
||||
|
||||
import os.path
|
||||
import re
|
||||
import sys
|
||||
import types
|
||||
|
@ -1640,9 +1639,9 @@ class TaskTests(test_utils.TestCase):
|
|||
asyncio.coroutines._DEBUG = debug
|
||||
|
||||
tb_filename = __file__
|
||||
tb_lineno = sys._getframe().f_lineno + 1
|
||||
coro = coro_noop()
|
||||
coro = None
|
||||
tb_lineno = sys._getframe().f_lineno + 2
|
||||
# create a coroutine object but don't use it
|
||||
coro_noop()
|
||||
support.gc_collect()
|
||||
|
||||
self.assertTrue(m_log.error.called)
|
||||
|
@ -1652,7 +1651,7 @@ class TaskTests(test_utils.TestCase):
|
|||
r'Coroutine object created at \(most recent call last\):\n'
|
||||
r'.*\n'
|
||||
r' File "%s", line %s, in test_coroutine_never_yielded\n'
|
||||
r' coro = coro_noop\(\)$'
|
||||
r' coro_noop\(\)$'
|
||||
% (re.escape(coro_noop.__qualname__),
|
||||
re.escape(func_filename), func_lineno,
|
||||
re.escape(tb_filename), tb_lineno))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue