Пример #1
0
 def test_context_manager__False(self):
     with util.alarm(0, set_signal=False) as result:
         self.assertFalse(result)
Пример #2
0
 def _wrapped_function(self, set_signal=True):
     with util.alarm(1, set_signal=set_signal):
         return self._long_function()
Пример #3
0
 def test_context_manager__True(self):
     with util.alarm(1) as result:
         self.assertTrue(result)
Пример #4
0
 def handle_mutagen_task_with_alarm(self, msg):
     with util.alarm(2):
         return self.handle_mutagen_task(msg)
Пример #5
0
 def test_context_manager__False(self):
     with util.alarm(0, set_signal=False) as result:
         self.assertFalse(result)
Пример #6
0
 def test_context_manager__True(self):
     with util.alarm(1) as result:
         self.assertTrue(result)
Пример #7
0
 def _wrapped_function(self, set_signal=True):
     with util.alarm(1, set_signal=set_signal):
         return self._long_function()
Пример #8
0
 def handle_mutagen_task_with_alarm(self, msg):
     with util.alarm(2):
         return self.handle_mutagen_task(msg)