diff options
-rw-r--r-- | tests/tasks_test.py | 12 | ||||
-rw-r--r-- | tulip/selectors.py | 2 | ||||
-rw-r--r-- | tulip/tasks.py | 5 |
3 files changed, 10 insertions, 9 deletions
diff --git a/tests/tasks_test.py b/tests/tasks_test.py index 9ac15bb..ab71386 100644 --- a/tests/tasks_test.py +++ b/tests/tasks_test.py @@ -449,8 +449,8 @@ class TaskTests(test_utils.LogTrackingTestCase): task.set_result('ok') task._step() - self.assertTrue(m_logging.warn.called) - self.assertTrue(m_logging.warn.call_args[0][0].startswith( + self.assertTrue(m_logging.warning.called) + self.assertTrue(m_logging.warning.call_args[0][0].startswith( '_step(): already done: ')) @unittest.mock.patch('tulip.tasks.tulip_log') @@ -462,14 +462,14 @@ class TaskTests(test_utils.LogTrackingTestCase): task = tasks.Task(notmuch()) task._step() - self.assertFalse(m_logging.warn.called) + self.assertFalse(m_logging.warning.called) task._step() - self.assertTrue(m_logging.warn.called) + self.assertTrue(m_logging.warning.called) self.assertEqual( '_step(): bad yield: %r', - m_logging.warn.call_args[0][0]) - self.assertEqual(1, m_logging.warn.call_args[0][1]) + m_logging.warning.call_args[0][0]) + self.assertEqual(1, m_logging.warning.call_args[0][1]) def test_step_result_future(self): # If coroutine returns future, task waits on this future. diff --git a/tulip/selectors.py b/tulip/selectors.py index 57be7ab..bd81e55 100644 --- a/tulip/selectors.py +++ b/tulip/selectors.py @@ -196,7 +196,7 @@ class _BaseSelector: try: return self._fd_to_key[fd] except KeyError: - tulip_log.warn('No key found for fd %r', fd) + tulip_log.warning('No key found for fd %r', fd) return None diff --git a/tulip/tasks.py b/tulip/tasks.py index 81359a2..f385f49 100644 --- a/tulip/tasks.py +++ b/tulip/tasks.py @@ -102,7 +102,8 @@ class Task(futures.Future): def _step(self, value=None, exc=None): if self.done(): - tulip_log.warn('_step(): already done: %r, %r, %r', self, value, exc) + tulip_log.warning( + '_step(): already done: %r, %r, %r', self, value, exc) return # We'll call either coro.throw(exc) or coro.send(value). if self._must_cancel: @@ -162,7 +163,7 @@ class Task(futures.Future): 'generator in task %r with %s' % (self, result))) else: if result is not None: - tulip_log.warn('_step(): bad yield: %r', result) + tulip_log.warning('_step(): bad yield: %r', result) self._event_loop.call_soon(self._step) |