(arq_redis: ArqRedis, worker)
| 445 | |
| 446 | |
| 447 | async def test_startup_shutdown(arq_redis: ArqRedis, worker): |
| 448 | calls = [] |
| 449 | |
| 450 | async def startup(ctx): |
| 451 | calls.append('startup') |
| 452 | |
| 453 | async def shutdown(ctx): |
| 454 | calls.append('shutdown') |
| 455 | |
| 456 | await arq_redis.enqueue_job('foobar', _job_id='testing') |
| 457 | worker: Worker = worker(functions=[foobar], on_startup=startup, on_shutdown=shutdown) |
| 458 | await worker.main() |
| 459 | await worker.close() |
| 460 | |
| 461 | assert calls == ['startup', 'shutdown'] |
| 462 | |
| 463 | |
| 464 | class CustomError(RuntimeError): |
nothing calls this directly
no test coverage detected
searching dependent graphs…