Skip to content

Commit

Permalink
Fix test & linters
Browse files Browse the repository at this point in the history
  • Loading branch information
seedofjoy committed May 29, 2022
1 parent bac6e12 commit f4940f7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion darq/app.py
Expand Up @@ -295,7 +295,7 @@ async def delay(*args: t.Any, **kwargs: t.Any) -> t.Optional[Job]:
self.registry.add(Task.new(
coroutine=function, name=name,
keep_result=keep_result, timeout=timeout, max_tries=max_tries,
with_ctx=with_ctx
with_ctx=with_ctx,
))

return function
Expand Down
2 changes: 1 addition & 1 deletion darq/worker.py
Expand Up @@ -68,7 +68,7 @@ def new(
return cls(
name=name, coroutine=coroutine, timeout_s=to_seconds(timeout),
keep_result_s=to_seconds(keep_result), max_tries=max_tries,
with_ctx=with_ctx
with_ctx=with_ctx,
)


Expand Down
6 changes: 3 additions & 3 deletions tests/test_app.py
Expand Up @@ -113,7 +113,7 @@ async def test_task_parametrized(darq):
with_ctx = True
foobar_task = darq.task(
keep_result=keep_result, timeout=timeout,
max_tries=max_tries, queue=queue, with_ctx=with_ctx
max_tries=max_tries, queue=queue, with_ctx=with_ctx,
)(foobar)

task_name = 'tests.test_app.foobar'
Expand Down Expand Up @@ -399,7 +399,7 @@ async def foobar_with_ctx(ctx, a: int) -> int:
])
async def test_run_task_with_ctx(
func_args, func_kwargs, func_ctx, result,
arq_redis, caplog, worker_factory
arq_redis, caplog, worker_factory,
):
caplog.set_level(logging.INFO)

Expand All @@ -419,7 +419,7 @@ async def on_worker_startup(ctx):
job_id = 'testing'
function_name = 'tests.test_app.foobar_with_ctx'
await foobar_with_ctx_task.apply_async(
func_args, func_kwargs, job_id=job_id
func_args, func_kwargs, job_id=job_id,
)

worker = worker_factory(darq)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_registry.py
Expand Up @@ -15,12 +15,12 @@ def test_registry():
task_name = 'foobar_task'
worker_task = Task(
name=task_name, coroutine=foobar, timeout_s=None, keep_result_s=None,
max_tries=None,
max_tries=None, with_ctx=False,
)
task_name_2 = 'foobar_2_task'
worker_task_2 = Task(
name=task_name_2, coroutine=foobar_2, timeout_s=None,
keep_result_s=None, max_tries=None,
keep_result_s=None, max_tries=None, with_ctx=False,
)

registry.add(worker_task)
Expand Down

0 comments on commit f4940f7

Please sign in to comment.