summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
diff options
context:
space:
mode:
authorGuido van Rossum <guido@dropbox.com>2013-10-17 22:39:45 (GMT)
committerGuido van Rossum <guido@dropbox.com>2013-10-17 22:39:45 (GMT)
commitfc29e0f37e8a5928c3ef38ce7e02c64984d1b5bc (patch)
tree9c111dea008d9eec467e63d76d59502c2f5128a3 /Lib/test/test_asyncio
parentb795aa8547b5a615d715fedc6a6267b7e8811d94 (diff)
downloadcpython-fc29e0f37e8a5928c3ef38ce7e02c64984d1b5bc.zip
cpython-fc29e0f37e8a5928c3ef38ce7e02c64984d1b5bc.tar.gz
cpython-fc29e0f37e8a5928c3ef38ce7e02c64984d1b5bc.tar.bz2
Rename the logger to plain "logger".
Diffstat (limited to 'Lib/test/test_asyncio')
-rw-r--r--Lib/test/test_asyncio/test_base_events.py4
-rw-r--r--Lib/test/test_asyncio/test_events.py2
-rw-r--r--Lib/test/test_asyncio/test_futures.py12
-rw-r--r--Lib/test/test_asyncio/test_proactor_events.py6
-rw-r--r--Lib/test/test_asyncio/test_selector_events.py12
-rw-r--r--Lib/test/test_asyncio/test_unix_events.py14
6 files changed, 25 insertions, 25 deletions
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
index d48d12c..e62f476 100644
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -183,7 +183,7 @@ class BaseEventLoopTests(unittest.TestCase):
self.assertTrue(self.loop._process_events.called)
@unittest.mock.patch('asyncio.base_events.time')
- @unittest.mock.patch('asyncio.base_events.asyncio_log')
+ @unittest.mock.patch('asyncio.base_events.logger')
def test__run_once_logging(self, m_logging, m_time):
# Log to INFO level if timeout > 1.0 sec.
idx = -1
@@ -579,7 +579,7 @@ class BaseEventLoopWithSelectorTests(unittest.TestCase):
self.loop._accept_connection(MyProto, sock)
self.assertFalse(sock.close.called)
- @unittest.mock.patch('asyncio.selector_events.asyncio_log')
+ @unittest.mock.patch('asyncio.selector_events.logger')
def test_accept_connection_exception(self, m_log):
sock = unittest.mock.Mock()
sock.fileno.return_value = 10
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py
index 243f400..a9a9271 100644
--- a/Lib/test/test_asyncio/test_events.py
+++ b/Lib/test/test_asyncio/test_events.py
@@ -1320,7 +1320,7 @@ class HandleTests(unittest.TestCase):
self.assertRaises(
AssertionError, events.make_handle, h1, ())
- @unittest.mock.patch('asyncio.events.asyncio_log')
+ @unittest.mock.patch('asyncio.events.logger')
def test_callback_with_exception(self, log):
def callback():
raise ValueError()
diff --git a/Lib/test/test_asyncio/test_futures.py b/Lib/test/test_asyncio/test_futures.py
index 9b5108c..ccea2ff 100644
--- a/Lib/test/test_asyncio/test_futures.py
+++ b/Lib/test/test_asyncio/test_futures.py
@@ -170,20 +170,20 @@ class FutureTests(unittest.TestCase):
self.assertRaises(AssertionError, test)
fut.cancel()
- @unittest.mock.patch('asyncio.futures.asyncio_log')
+ @unittest.mock.patch('asyncio.futures.logger')
def test_tb_logger_abandoned(self, m_log):
fut = futures.Future(loop=self.loop)
del fut
self.assertFalse(m_log.error.called)
- @unittest.mock.patch('asyncio.futures.asyncio_log')
+ @unittest.mock.patch('asyncio.futures.logger')
def test_tb_logger_result_unretrieved(self, m_log):
fut = futures.Future(loop=self.loop)
fut.set_result(42)
del fut
self.assertFalse(m_log.error.called)
- @unittest.mock.patch('asyncio.futures.asyncio_log')
+ @unittest.mock.patch('asyncio.futures.logger')
def test_tb_logger_result_retrieved(self, m_log):
fut = futures.Future(loop=self.loop)
fut.set_result(42)
@@ -191,7 +191,7 @@ class FutureTests(unittest.TestCase):
del fut
self.assertFalse(m_log.error.called)
- @unittest.mock.patch('asyncio.futures.asyncio_log')
+ @unittest.mock.patch('asyncio.futures.logger')
def test_tb_logger_exception_unretrieved(self, m_log):
fut = futures.Future(loop=self.loop)
fut.set_exception(RuntimeError('boom'))
@@ -199,7 +199,7 @@ class FutureTests(unittest.TestCase):
test_utils.run_briefly(self.loop)
self.assertTrue(m_log.error.called)
- @unittest.mock.patch('asyncio.futures.asyncio_log')
+ @unittest.mock.patch('asyncio.futures.logger')
def test_tb_logger_exception_retrieved(self, m_log):
fut = futures.Future(loop=self.loop)
fut.set_exception(RuntimeError('boom'))
@@ -207,7 +207,7 @@ class FutureTests(unittest.TestCase):
del fut
self.assertFalse(m_log.error.called)
- @unittest.mock.patch('asyncio.futures.asyncio_log')
+ @unittest.mock.patch('asyncio.futures.logger')
def test_tb_logger_exception_result_retrieved(self, m_log):
fut = futures.Future(loop=self.loop)
fut.set_exception(RuntimeError('boom'))
diff --git a/Lib/test/test_asyncio/test_proactor_events.py b/Lib/test/test_asyncio/test_proactor_events.py
index c52ade0..e4dd609 100644
--- a/Lib/test/test_asyncio/test_proactor_events.py
+++ b/Lib/test/test_asyncio/test_proactor_events.py
@@ -135,7 +135,7 @@ class ProactorSocketTransportTests(unittest.TestCase):
self.loop._proactor.send.return_value.add_done_callback.\
assert_called_with(tr._loop_writing)
- @unittest.mock.patch('asyncio.proactor_events.asyncio_log')
+ @unittest.mock.patch('asyncio.proactor_events.logger')
def test_loop_writing_err(self, m_log):
err = self.loop._proactor.send.side_effect = OSError()
tr = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
@@ -207,7 +207,7 @@ class ProactorSocketTransportTests(unittest.TestCase):
test_utils.run_briefly(self.loop)
self.assertFalse(self.protocol.connection_lost.called)
- @unittest.mock.patch('asyncio.proactor_events.asyncio_log')
+ @unittest.mock.patch('asyncio.proactor_events.logger')
def test_fatal_error(self, m_logging):
tr = _ProactorSocketTransport(self.loop, self.sock, self.protocol)
tr._force_close = unittest.mock.Mock()
@@ -432,7 +432,7 @@ class BaseProactorEventLoopTests(unittest.TestCase):
def test_process_events(self):
self.loop._process_events([])
- @unittest.mock.patch('asyncio.proactor_events.asyncio_log')
+ @unittest.mock.patch('asyncio.proactor_events.logger')
def test_create_server(self, m_log):
pf = unittest.mock.Mock()
call_soon = self.loop.call_soon = unittest.mock.Mock()
diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py
index 0225e13..1465cd2 100644
--- a/Lib/test/test_asyncio/test_selector_events.py
+++ b/Lib/test/test_asyncio/test_selector_events.py
@@ -626,7 +626,7 @@ class SelectorTransportTests(unittest.TestCase):
self.assertFalse(self.loop.readers)
self.assertEqual(1, self.loop.remove_reader_count[7])
- @unittest.mock.patch('asyncio.log.asyncio_log.exception')
+ @unittest.mock.patch('asyncio.log.logger.exception')
def test_fatal_error(self, m_exc):
exc = OSError()
tr = _SelectorTransport(self.loop, self.sock, self.protocol, None)
@@ -823,7 +823,7 @@ class SelectorSocketTransportTests(unittest.TestCase):
self.loop.assert_writer(7, transport._write_ready)
self.assertEqual(collections.deque([b'data']), transport._buffer)
- @unittest.mock.patch('asyncio.selector_events.asyncio_log')
+ @unittest.mock.patch('asyncio.selector_events.logger')
def test_write_exception(self, m_log):
err = self.sock.send.side_effect = OSError()
@@ -937,7 +937,7 @@ class SelectorSocketTransportTests(unittest.TestCase):
transport._write_ready()
transport._fatal_error.assert_called_with(err)
- @unittest.mock.patch('asyncio.selector_events.asyncio_log')
+ @unittest.mock.patch('asyncio.selector_events.logger')
def test_write_ready_exception_and_close(self, m_log):
self.sock.send.side_effect = OSError()
remove_writer = self.loop.remove_writer = unittest.mock.Mock()
@@ -1072,7 +1072,7 @@ class SelectorSslTransportTests(unittest.TestCase):
transport.write(b'data')
self.assertEqual(transport._conn_lost, 2)
- @unittest.mock.patch('asyncio.selector_events.asyncio_log')
+ @unittest.mock.patch('asyncio.selector_events.logger')
def test_write_exception(self, m_log):
transport = self._make_one()
transport._conn_lost = 1
@@ -1325,7 +1325,7 @@ class SelectorDatagramTransportTests(unittest.TestCase):
self.assertEqual(
[(b'data', ('0.0.0.0', 12345))], list(transport._buffer))
- @unittest.mock.patch('asyncio.selector_events.asyncio_log')
+ @unittest.mock.patch('asyncio.selector_events.logger')
def test_sendto_exception(self, m_log):
data = b'data'
err = self.sock.sendto.side_effect = OSError()
@@ -1475,7 +1475,7 @@ class SelectorDatagramTransportTests(unittest.TestCase):
self.assertTrue(transport._fatal_error.called)
- @unittest.mock.patch('asyncio.log.asyncio_log.exception')
+ @unittest.mock.patch('asyncio.log.logger.exception')
def test_fatal_error_connected(self, m_exc):
transport = _SelectorDatagramTransport(
self.loop, self.sock, self.protocol, ('0.0.0.0', 1))
diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py
index 6dbd47f..227366d 100644
--- a/Lib/test/test_asyncio/test_unix_events.py
+++ b/Lib/test/test_asyncio/test_unix_events.py
@@ -87,7 +87,7 @@ class SelectorEventLoopTests(unittest.TestCase):
signal.SIGINT, lambda: True)
@unittest.mock.patch('asyncio.unix_events.signal')
- @unittest.mock.patch('asyncio.unix_events.asyncio_log')
+ @unittest.mock.patch('asyncio.unix_events.logger')
def test_add_signal_handler_install_error2(self, m_logging, m_signal):
m_signal.NSIG = signal.NSIG
@@ -104,7 +104,7 @@ class SelectorEventLoopTests(unittest.TestCase):
self.assertEqual(1, m_signal.set_wakeup_fd.call_count)
@unittest.mock.patch('asyncio.unix_events.signal')
- @unittest.mock.patch('asyncio.unix_events.asyncio_log')
+ @unittest.mock.patch('asyncio.unix_events.logger')
def test_add_signal_handler_install_error3(self, m_logging, m_signal):
class Err(OSError):
errno = errno.EINVAL
@@ -149,7 +149,7 @@ class SelectorEventLoopTests(unittest.TestCase):
m_signal.signal.call_args[0])
@unittest.mock.patch('asyncio.unix_events.signal')
- @unittest.mock.patch('asyncio.unix_events.asyncio_log')
+ @unittest.mock.patch('asyncio.unix_events.logger')
def test_remove_signal_handler_cleanup_error(self, m_logging, m_signal):
m_signal.NSIG = signal.NSIG
self.loop.add_signal_handler(signal.SIGHUP, lambda: True)
@@ -270,7 +270,7 @@ class SelectorEventLoopTests(unittest.TestCase):
self.assertFalse(m_WEXITSTATUS.called)
self.assertFalse(m_WTERMSIG.called)
- @unittest.mock.patch('asyncio.unix_events.asyncio_log')
+ @unittest.mock.patch('asyncio.unix_events.logger')
@unittest.mock.patch('os.WTERMSIG')
@unittest.mock.patch('os.WEXITSTATUS')
@unittest.mock.patch('os.WIFSIGNALED')
@@ -360,7 +360,7 @@ class UnixReadPipeTransportTests(unittest.TestCase):
test_utils.run_briefly(self.loop)
self.assertFalse(self.protocol.data_received.called)
- @unittest.mock.patch('asyncio.log.asyncio_log.exception')
+ @unittest.mock.patch('asyncio.log.logger.exception')
@unittest.mock.patch('os.read')
def test__read_ready_error(self, m_read, m_logexc):
tr = unix_events._UnixReadPipeTransport(
@@ -550,7 +550,7 @@ class UnixWritePipeTransportTests(unittest.TestCase):
self.loop.assert_writer(5, tr._write_ready)
self.assertEqual([b'data'], tr._buffer)
- @unittest.mock.patch('asyncio.unix_events.asyncio_log')
+ @unittest.mock.patch('asyncio.unix_events.logger')
@unittest.mock.patch('os.write')
def test_write_err(self, m_write, m_log):
tr = unix_events._UnixWritePipeTransport(
@@ -648,7 +648,7 @@ class UnixWritePipeTransportTests(unittest.TestCase):
self.loop.assert_writer(5, tr._write_ready)
self.assertEqual([b'data'], tr._buffer)
- @unittest.mock.patch('asyncio.log.asyncio_log.exception')
+ @unittest.mock.patch('asyncio.log.logger.exception')
@unittest.mock.patch('os.write')
def test__write_ready_err(self, m_write, m_logexc):
tr = unix_events._UnixWritePipeTransport(