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

Function test_str_function

tests/test_worker.py:431–444  ·  view source on GitHub ↗
(arq_redis: ArqRedis, worker, caplog)

Source from the content-addressed store, hash-verified

429
430
431async def test_str_function(arq_redis: ArqRedis, worker, caplog):
432 caplog.set_level(logging.INFO)
433 await arq_redis.enqueue_job('asyncio.sleep', _job_id='testing')
434 worker: Worker = worker(functions=['asyncio.sleep'])
435 assert worker.jobs_complete == 0
436 assert worker.jobs_failed == 0
437 assert worker.jobs_retried == 0
438 await worker.main()
439 assert worker.jobs_complete == 0
440 assert worker.jobs_failed == 1
441 assert worker.jobs_retried == 0
442
443 log = re.sub(r'(\d+).\d\ds', r'\1.XXs', '\n'.join(r.message for r in caplog.records))
444 assert '0.XXs ! testing:asyncio.sleep failed, TypeError' in log
445
446
447async def test_startup_shutdown(arq_redis: ArqRedis, worker):

Callers

nothing calls this directly

Calls 3

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…