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

Function test_custom_try

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

Source from the content-addressed store, hash-verified

189
190
191async def test_custom_try(arq_redis: ArqRedis, worker):
192 async def foobar(ctx):
193 return ctx['job_try']
194
195 j1 = await arq_redis.enqueue_job('foobar')
196 w: Worker = worker(functions=[func(foobar, name='foobar')])
197 await w.main()
198 r = await j1.result(poll_delay=0)
199 assert r == 1
200
201 j2 = await arq_redis.enqueue_job('foobar', _job_try=3)
202 await w.main()
203 r = await j2.result(poll_delay=0)
204 assert r == 3
205
206
207async def test_custom_try2(arq_redis: ArqRedis, worker):

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…