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

Function test_custom_serializers

tests/test_worker.py:701–711  ·  view source on GitHub ↗
(arq_redis_msgpack: ArqRedis, worker)

Source from the content-addressed store, hash-verified

699
700
701async def test_custom_serializers(arq_redis_msgpack: ArqRedis, worker):
702 j = await arq_redis_msgpack.enqueue_job('foobar', _job_id='job_id')
703 worker: Worker = worker(
704 functions=[foobar], job_serializer=msgpack.packb, job_deserializer=functools.partial(msgpack.unpackb, raw=False)
705 )
706 info = await j.info()
707 assert info.function == 'foobar'
708 assert await worker.run_check() == 1
709 assert await j.result() == 42
710 r = await j.info()
711 assert r.result == 42
712
713
714class UnpickleFails:

Callers

nothing calls this directly

Calls 5

workerFunction · 0.85
enqueue_jobMethod · 0.80
infoMethod · 0.80
run_checkMethod · 0.80
resultMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…