示例#1
0
 def test_on_retry(self):
     tw = TaskRequest(mytask.name, uuid(), [1], {"f": "x"})
     tw.eventer = MockEventDispatcher()
     try:
         raise RetryTaskError("foo", KeyError("moofoobar"))
     except:
         einfo = ExceptionInfo()
         tw.on_failure(einfo)
         self.assertIn("task-retried", tw.eventer.sent)
         tw._does_info = False
         tw.on_failure(einfo)
         einfo.internal = True
         tw.on_failure(einfo)
示例#2
0
 def test_on_retry(self):
     tw = TaskRequest(mytask.name, uuid(), [1], {"f": "x"})
     tw.eventer = MockEventDispatcher()
     try:
         raise RetryTaskError("foo", KeyError("moofoobar"))
     except:
         einfo = ExceptionInfo(sys.exc_info())
         tw.on_failure(einfo)
         self.assertIn("task-retried", tw.eventer.sent)
         tw._does_info = False
         tw.on_failure(einfo)
         einfo.internal = True
         tw.on_failure(einfo)
示例#3
0
 def test_on_retry(self):
     tw = TaskRequest(mytask.name, uuid(), [1], {'f': 'x'})
     tw.eventer = MockEventDispatcher()
     try:
         raise RetryTaskError('foo', KeyError('moofoobar'))
     except:
         einfo = ExceptionInfo()
         tw.on_failure(einfo)
         self.assertIn('task-retried', tw.eventer.sent)
         prev, module._does_info = module._does_info, False
         try:
             tw.on_failure(einfo)
         finally:
             module._does_info = prev
         einfo.internal = True
         tw.on_failure(einfo)
示例#4
0
 def test_on_retry(self):
     tw = TaskRequest(mytask.name, uuid(), [1], {'f': 'x'})
     tw.eventer = MockEventDispatcher()
     try:
         raise RetryTaskError('foo', KeyError('moofoobar'))
     except:
         einfo = ExceptionInfo()
         tw.on_failure(einfo)
         self.assertIn('task-retried', tw.eventer.sent)
         prev, module._does_info = module._does_info, False
         try:
             tw.on_failure(einfo)
         finally:
             module._does_info = prev
         einfo.internal = True
         tw.on_failure(einfo)