summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2018-09-30 05:28:40 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-09-30 05:28:40 (GMT)
commitd5bd036138881bb90a803397d992870a46fbdc2d (patch)
tree5375a0724482a249efa43a963d55ddf9ba9ec709 /Lib/test/test_asyncio
parentdf8101517aa1c917fdf8aeb466e480c26d4e878c (diff)
downloadcpython-d5bd036138881bb90a803397d992870a46fbdc2d.zip
cpython-d5bd036138881bb90a803397d992870a46fbdc2d.tar.gz
cpython-d5bd036138881bb90a803397d992870a46fbdc2d.tar.bz2
bpo-34849: Don't log wating for selector.select in asyncio loop iteration (GH-9641)
The waiting is pretty normal for any asyncio program, logging its time just adds a noise to logs without any useful information provided. https://bugs.python.org/issue34849
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r--Lib/test/test_asyncio/test_base_events.py25
1 files changed, 0 insertions, 25 deletions
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
index 95f4f6b..4224469 100644
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -371,31 +371,6 @@ class BaseEventLoopTests(test_utils.TestCase):
self.loop.set_debug(False)
self.assertFalse(self.loop.get_debug())
- @mock.patch('asyncio.base_events.logger')
- def test__run_once_logging(self, m_logger):
- def slow_select(timeout):
- # Sleep a bit longer than a second to avoid timer resolution
- # issues.
- time.sleep(1.1)
- return []
-
- # logging needs debug flag
- self.loop.set_debug(True)
-
- # Log to INFO level if timeout > 1.0 sec.
- self.loop._selector.select = slow_select
- self.loop._process_events = mock.Mock()
- self.loop._run_once()
- self.assertEqual(logging.INFO, m_logger.log.call_args[0][0])
-
- def fast_select(timeout):
- time.sleep(0.001)
- return []
-
- self.loop._selector.select = fast_select
- self.loop._run_once()
- self.assertEqual(logging.DEBUG, m_logger.log.call_args[0][0])
-
def test__run_once_schedule_handle(self):
handle = None
processed = False