Skip to content

Commit

Permalink
use worker.main() in tests, uprev
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Aug 30, 2019
1 parent 0917b6f commit fd59bfc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
History
-------

v0.18 (unreleased)
v0.18 (2019-08-30)
..................
* fix usage of ``max_burst_jobs``, improve coverage fix #152
* stop lots of ``WatchVariableError`` errors in log, #153
Expand Down
2 changes: 1 addition & 1 deletion arq/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__all__ = ['VERSION']

VERSION = StrictVersion('0.18a1')
VERSION = StrictVersion('0.18')
8 changes: 4 additions & 4 deletions tests/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ async def return_error(ctx):

j = await arq_redis.enqueue_job('return_error')
worker: Worker = worker(functions=[func(return_error, name='return_error')])
await worker.async_run()
await worker.main()
assert (worker.jobs_complete, worker.jobs_failed, worker.jobs_retried) == (1, 0, 0)
r = await j.result(pole_delay=0)
assert isinstance(r, TypeError)
Expand All @@ -420,7 +420,7 @@ async def return_error(ctx):
async def test_error_success(arq_redis: ArqRedis, worker):
j = await arq_redis.enqueue_job('fails')
worker: Worker = worker(functions=[func(fails, name='fails')])
await worker.async_run()
await worker.main()
assert (worker.jobs_complete, worker.jobs_failed, worker.jobs_retried) == (0, 1, 0)
info = await j.result_info()
assert info.success is False
Expand Down Expand Up @@ -540,7 +540,7 @@ async def test_deserialization_error(arq_redis: ArqRedis, worker):
async def test_incompatible_serializers_1(arq_redis_msgpack: ArqRedis, worker):
await arq_redis_msgpack.enqueue_job('foobar', _job_id='job_id')
worker: Worker = worker(functions=[foobar])
await worker.async_run()
await worker.main()
assert worker.jobs_complete == 0
assert worker.jobs_failed == 1
assert worker.jobs_retried == 0
Expand All @@ -551,7 +551,7 @@ async def test_incompatible_serializers_2(arq_redis: ArqRedis, worker):
worker: Worker = worker(
functions=[foobar], job_serializer=msgpack.packb, job_deserializer=functools.partial(msgpack.unpackb, raw=False)
)
await worker.async_run()
await worker.main()
assert worker.jobs_complete == 0
assert worker.jobs_failed == 1
assert worker.jobs_retried == 0
Expand Down

0 comments on commit fd59bfc

Please sign in to comment.