(arq_redis: ArqRedis, worker, caplog)
| 471 | |
| 472 | |
| 473 | async def test_exc_extra(arq_redis: ArqRedis, worker, caplog): |
| 474 | caplog.set_level(logging.INFO) |
| 475 | await arq_redis.enqueue_job('error_function', _job_id='testing') |
| 476 | worker: Worker = worker(functions=[error_function]) |
| 477 | await worker.main() |
| 478 | assert worker.jobs_failed == 1 |
| 479 | |
| 480 | log = re.sub(r'(\d+).\d\ds', r'\1.XXs', '\n'.join(r.message for r in caplog.records)) |
| 481 | assert '0.XXs ! testing:error_function failed, CustomError: this is the error' in log |
| 482 | error = next(r for r in caplog.records if r.levelno == logging.ERROR) |
| 483 | assert error.extra == {'x': 'y'} |
| 484 | |
| 485 | |
| 486 | async def test_unpickleable(arq_redis: ArqRedis, worker, caplog): |
nothing calls this directly
no test coverage detected
searching dependent graphs…