本文整理汇总了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)
示例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)
示例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)
示例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)
示例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)