MCPcopy Create free account
hub / github.com/python-arq/arq / test_custom_try2

Function test_custom_try2

tests/test_main.py:207–217  ·  view source on GitHub ↗
(arq_redis: ArqRedis, worker)

Source from the content-addressed store, hash-verified

205
206
207async def test_custom_try2(arq_redis: ArqRedis, worker):
208 async def foobar(ctx):
209 if ctx['job_try'] == 3:
210 raise Retry()
211 return ctx['job_try']
212
213 j1 = await arq_redis.enqueue_job('foobar', _job_try=3)
214 w: Worker = worker(functions=[func(foobar, name='foobar')])
215 await w.main()
216 r = await j1.result(poll_delay=0)
217 assert r == 4
218
219
220async def test_cant_pickle_arg(arq_redis: ArqRedis):

Callers

nothing calls this directly

Calls 5

funcFunction · 0.90
workerFunction · 0.85
enqueue_jobMethod · 0.80
mainMethod · 0.80
resultMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…