diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-02-26 10:07:42 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-02-26 10:07:42 (GMT) |
commit | f5e37037cc14bd30f2a270326852970d46bc648f (patch) | |
tree | 22d2178338ea80627aa62354c06acae4c560e9e3 /Lib/test/test_asyncio/test_unix_events.py | |
parent | 24ba2035048566df2e0876fb719749d984234bc7 (diff) | |
download | cpython-f5e37037cc14bd30f2a270326852970d46bc648f.zip cpython-f5e37037cc14bd30f2a270326852970d46bc648f.tar.gz cpython-f5e37037cc14bd30f2a270326852970d46bc648f.tar.bz2 |
asyncio: Fix pyflakes warnings: remove unused variables and imports
Diffstat (limited to 'Lib/test/test_asyncio/test_unix_events.py')
-rw-r--r-- | Lib/test/test_asyncio/test_unix_events.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py index 3b187de..cc74383 100644 --- a/Lib/test/test_asyncio/test_unix_events.py +++ b/Lib/test/test_asyncio/test_unix_events.py @@ -1302,7 +1302,7 @@ class ChildWatcherTestsMixin: m.waitpid.side_effect = ValueError with mock.patch.object(log.logger, - 'error') as m_error: + 'error') as m_error: self.assertEqual(self.watcher._sig_chld(), None) self.assertTrue(m_error.called) @@ -1376,19 +1376,16 @@ class ChildWatcherTestsMixin: # attach a new loop old_loop = self.loop self.loop = test_utils.TestLoop() + patch = mock.patch.object - with mock.patch.object( - old_loop, - "remove_signal_handler") as m_old_remove_signal_handler, \ - mock.patch.object( - self.loop, - "add_signal_handler") as m_new_add_signal_handler: + with patch(old_loop, "remove_signal_handler") as m_old_remove, \ + patch(self.loop, "add_signal_handler") as m_new_add: self.watcher.attach_loop(self.loop) - m_old_remove_signal_handler.assert_called_once_with( + m_old_remove.assert_called_once_with( signal.SIGCHLD) - m_new_add_signal_handler.assert_called_once_with( + m_new_add.assert_called_once_with( signal.SIGCHLD, self.watcher._sig_chld) # child terminates @@ -1462,7 +1459,6 @@ class ChildWatcherTestsMixin: def test_close(self, m): # register two children callback1 = mock.Mock() - callback2 = mock.Mock() with self.watcher: self.running = True |