(arq_redis: ArqRedis, worker, caplog)
| 836 | |
| 837 | |
| 838 | async def test_multi_exec(arq_redis: ArqRedis, worker, caplog): |
| 839 | c = 0 |
| 840 | |
| 841 | async def foo(ctx, v): |
| 842 | nonlocal c |
| 843 | c += 1 |
| 844 | return v + 1 |
| 845 | |
| 846 | caplog.set_level(logging.DEBUG, logger='arq.worker') |
| 847 | await arq_redis.enqueue_job('foo', 1, _job_id='testing') |
| 848 | worker: Worker = worker(functions=[func(foo, name='foo')]) |
| 849 | await asyncio.gather(*[worker.start_jobs([b'testing']) for _ in range(5)]) |
| 850 | # debug(caplog.text) |
| 851 | await worker.main() |
| 852 | assert c == 1 |
| 853 | # assert 'multi-exec error, job testing already started elsewhere' in caplog.text |
| 854 | # assert 'WatchVariableError' not in caplog.text |
| 855 | |
| 856 | |
| 857 | async def test_abort_job(arq_redis: ArqRedis, worker, caplog, loop): |
nothing calls this directly
no test coverage detected
searching dependent graphs…