summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test_unix_events.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/tests/test_unix_events.py b/tests/test_unix_events.py
index 3b187de..792e702 100644
--- a/tests/test_unix_events.py
+++ b/tests/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