示例#1
0
 def test_context_manager_exception(self):
     with self.assertRaises(RuntimeError):
         with parallel_task_queue() as queue:
             queue.enqueue_task(_fake_task, 1, a=2)
             queue.enqueue_task(_fake_exception)
示例#2
0
 def test_context_manager_exception(self):
     with self.assertRaises(RuntimeError):
         with parallel_task_queue() as queue:
             queue.enqueue_task(_fake_task, 1, a=2)
             queue.enqueue_task(_fake_exception)
示例#3
0
 def test_context_manager(self):
     with parallel_task_queue() as queue:
         queue.enqueue_task(_fake_task, 1, a=2)
         queue.enqueue_task(_fake_task, 3, b=4)
     global_mock.assert_has_calls([call(1, a=2), call(3, b=4)],
                                  any_order=True)
示例#4
0
 def test_context_manager(self):
     with parallel_task_queue() as queue:
         queue.enqueue_task(_fake_task, 1, a=2)
         queue.enqueue_task(_fake_task, 3, b=4)
     global_mock.assert_has_calls([call(1, a=2),
                                   call(3, b=4)], any_order=True)