当前位置: 首页>>代码示例>>Python>>正文


Python ExceptionInfo.internal方法代码示例

本文整理汇总了Python中billiard.einfo.ExceptionInfo.internal方法的典型用法代码示例。如果您正苦于以下问题:Python ExceptionInfo.internal方法的具体用法?Python ExceptionInfo.internal怎么用?Python ExceptionInfo.internal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在billiard.einfo.ExceptionInfo的用法示例。


在下文中一共展示了ExceptionInfo.internal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_on_retry

# 需要导入模块: from billiard.einfo import ExceptionInfo [as 别名]
# 或者: from billiard.einfo.ExceptionInfo import internal [as 别名]
 def test_on_retry(self):
     job = self.get_request(self.mytask.s(1, f='x'))
     job.eventer = MockEventDispatcher()
     try:
         raise Retry('foo', KeyError('moofoobar'))
     except:
         einfo = ExceptionInfo()
         job.on_failure(einfo)
         self.assertIn('task-retried', job.eventer.sent)
         prev, module._does_info = module._does_info, False
         try:
             job.on_failure(einfo)
         finally:
             module._does_info = prev
         einfo.internal = True
         job.on_failure(einfo)
开发者ID:hanshoudong,项目名称:celery,代码行数:18,代码来源:test_request.py

示例2: test_on_retry

# 需要导入模块: from billiard.einfo import ExceptionInfo [as 别名]
# 或者: from billiard.einfo.ExceptionInfo import internal [as 别名]
 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)
开发者ID:arunsuresh,项目名称:celery,代码行数:18,代码来源:test_request.py

示例3: test_on_retry

# 需要导入模块: from billiard.einfo import ExceptionInfo [as 别名]
# 或者: from billiard.einfo.ExceptionInfo import internal [as 别名]
 def test_on_retry(self):
     job = Request({"task": self.mytask.name, "id": uuid(), "args": [1], "kwargs": {"f": "x"}}, app=self.app)
     job.eventer = MockEventDispatcher()
     try:
         raise Retry("foo", KeyError("moofoobar"))
     except:
         einfo = ExceptionInfo()
         job.on_failure(einfo)
         self.assertIn("task-retried", job.eventer.sent)
         prev, module._does_info = module._does_info, False
         try:
             job.on_failure(einfo)
         finally:
             module._does_info = prev
         einfo.internal = True
         job.on_failure(einfo)
开发者ID:rhayesbite,项目名称:celery,代码行数:18,代码来源:test_request.py

示例4: test_on_retry

# 需要导入模块: from billiard.einfo import ExceptionInfo [as 别名]
# 或者: from billiard.einfo.ExceptionInfo import internal [as 别名]
 def test_on_retry(self):
     job = self.get_request(self.mytask.s(1, f='x'))
     job.eventer = Mock(name='.eventer')
     try:
         raise Retry('foo', KeyError('moofoobar'))
     except:
         einfo = ExceptionInfo()
         job.on_failure(einfo)
         job.eventer.send.assert_called_with(
             'task-retried',
             uuid=job.id,
             exception=safe_repr(einfo.exception.exc),
             traceback=safe_str(einfo.traceback),
         )
         prev, module._does_info = module._does_info, False
         try:
             job.on_failure(einfo)
         finally:
             module._does_info = prev
         einfo.internal = True
         job.on_failure(einfo)
开发者ID:alekibango,项目名称:celery,代码行数:23,代码来源:test_request.py

示例5: test_on_retry

# 需要导入模块: from billiard.einfo import ExceptionInfo [as 别名]
# 或者: from billiard.einfo.ExceptionInfo import internal [as 别名]
 def test_on_retry(self):
     job = Request({
         'task': self.mytask.name,
         'id': uuid(),
         'args': [1],
         'kwargs': {'f': 'x'},
     }, app=self.app)
     job.eventer = MockEventDispatcher()
     try:
         raise Retry('foo', KeyError('moofoobar'))
     except:
         einfo = ExceptionInfo()
         job.on_failure(einfo)
         self.assertIn('task-retried', job.eventer.sent)
         prev, module._does_info = module._does_info, False
         try:
             job.on_failure(einfo)
         finally:
             module._does_info = prev
         einfo.internal = True
         job.on_failure(einfo)
开发者ID:Arizona-Tecnologia,项目名称:celery,代码行数:23,代码来源:test_request.py


注:本文中的billiard.einfo.ExceptionInfo.internal方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。