MCPcopy
hub / github.com/celery/celery / test_raising_remote_tracebacks

Method test_raising_remote_tracebacks

t/unit/tasks/test_result.py:265–276  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

263 assert excinfo.typename == 'KeyError'
264
265 def test_raising_remote_tracebacks(self):
266 pytest.importorskip('tblib')
267
268 withtb = self.app.AsyncResult(self.task5['id'])
269 self.app.conf.task_remote_tracebacks = True
270 with pytest.raises(KeyError) as excinfo:
271 withtb.get()
272 tb = [t.strip() for t in traceback.format_tb(excinfo.tb)]
273 assert 'File "foo.py", line 2, in foofunc' in tb
274 assert 'File "bar.py", line 3, in barfunc' in tb
275 assert excinfo.value.args[0] == 'blue'
276 assert excinfo.typename == 'KeyError'
277
278 def test_str(self):
279 ok_res = self.app.AsyncResult(self.task1['id'])

Callers

nothing calls this directly

Calls 3

getMethod · 0.95
AsyncResultMethod · 0.45
raisesMethod · 0.45

Tested by

no test coverage detected