MCPcopy
hub / github.com/celery/celery / test_get_timeout

Method test_get_timeout

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

Source from the content-addressed store, hash-verified

364 assert fun(*args) == r1
365
366 def test_get_timeout(self):
367 res = self.app.AsyncResult(self.task4['id']) # has RETRY state
368 with pytest.raises(TimeoutError):
369 res.get(timeout=0.001)
370
371 pending_res = self.app.AsyncResult(uuid())
372 with patch('celery.result.time') as _time:
373 with pytest.raises(TimeoutError):
374 pending_res.get(timeout=0.001, interval=0.001)
375 _time.sleep.assert_called_with(0.001)
376
377 def test_get_timeout_longer(self):
378 res = self.app.AsyncResult(self.task4['id']) # has RETRY state

Callers

nothing calls this directly

Calls 3

getMethod · 0.95
AsyncResultMethod · 0.45
raisesMethod · 0.45

Tested by

no test coverage detected