MCPcopy
hub / github.com/celery/celery / test_mark_as_failure

Method test_mark_as_failure

t/unit/backends/test_database.py:341–353  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

339 assert tb.get_traceback(tid) == trace
340
341 def test_mark_as_failure(self):
342 tb = DatabaseBackend(self.uri, app=self.app)
343
344 tid3 = uuid()
345 try:
346 raise KeyError('foo')
347 except KeyError as exception:
348 import traceback
349 trace = '\n'.join(traceback.format_stack())
350 tb.mark_as_failure(tid3, exception, traceback=trace)
351 assert tb.get_state(tid3) == states.FAILURE
352 assert isinstance(tb.get_result(tid3), KeyError)
353 assert tb.get_traceback(tid3) == trace
354
355 def test_forget(self):
356 tb = DatabaseBackend(self.uri, backend='memory://', app=self.app)

Callers

nothing calls this directly

Calls 6

DatabaseBackendClass · 0.90
mark_as_failureMethod · 0.80
get_stateMethod · 0.80
get_resultMethod · 0.80
get_tracebackMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected