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

Function test_enqueue_job_nested

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

Source from the content-addressed store, hash-verified

47
48
49async def test_enqueue_job_nested(arq_redis: ArqRedis, worker):
50 async def foobar(ctx):
51 return 42
52
53 async def parent_job(ctx):
54 inner_job = await ctx['redis'].enqueue_job('foobar')
55 return inner_job.job_id
56
57 job = await arq_redis.enqueue_job('parent_job')
58 worker: Worker = worker(functions=[func(parent_job, name='parent_job'), func(foobar, name='foobar')])
59
60 await worker.main()
61 result = await job.result(poll_delay=0)
62 assert result is not None
63 inner_job = Job(result, arq_redis)
64 inner_result = await inner_job.result(poll_delay=0)
65 assert inner_result == 42
66
67
68async def test_enqueue_job_nested_custom_serializer(

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…