MCPcopy Create free account
hub / github.com/celery/celery / test_mark_as_failure

Method test_mark_as_failure

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

Source from the content-addressed store, hash-verified

804 assert tb.get_traceback(tid) == trace
805
806 def test_mark_as_failure(self):
807 tb = DatabaseBackend(self.uri, app=self.app)
808
809 tid3 = uuid()
810 try:
811 raise KeyError('foo')
812 except KeyError as exception:
813 import traceback
814 trace = '\n'.join(traceback.format_stack())
815 tb.mark_as_failure(tid3, exception, traceback=trace)
816 assert tb.get_state(tid3) == states.FAILURE
817 assert isinstance(tb.get_result(tid3), KeyError)
818 assert tb.get_traceback(tid3) == trace
819
820 @pytest.mark.parametrize('state, result', [
821 (states.STARTED, {'pid': 1}),

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