Skip to content

Commit

Permalink
Run black
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielEidlin authored and JonatanMartens committed Apr 3, 2022
1 parent 50d892c commit a1f1707
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions tests/unit/task/task_builder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async def test_single_value_func(self, single_value_task_config: TaskConfig, moc

@pytest.mark.asyncio
async def test_no_additional_variables_are_added_to_result(
self, single_value_task_config: TaskConfig, mocked_job_with_adapter: Job
self, single_value_task_config: TaskConfig, mocked_job_with_adapter: Job
):
mocked_job_with_adapter.variables = {"x": 1}

Expand All @@ -53,7 +53,7 @@ def function_with_job_parameter(job: Job):

@pytest.mark.asyncio
async def test_job_parameter_is_removed_after_job_handler_call(
self, task_config: TaskConfig, mocked_job_with_adapter: Job
self, task_config: TaskConfig, mocked_job_with_adapter: Job
):
def function_with_job_parameter(job: Job):
return {"job": job}
Expand All @@ -71,7 +71,7 @@ def test_returned_task_is_callable(self, original_task_function: Callable, task_

@pytest.mark.asyncio
async def test_exception_handler_called(
self, original_task_function: Callable, task_config: TaskConfig, mocked_job_with_adapter: Job
self, original_task_function: Callable, task_config: TaskConfig, mocked_job_with_adapter: Job
):
exception = Exception()
original_task_function.side_effect = exception
Expand All @@ -83,7 +83,7 @@ async def test_exception_handler_called(

@pytest.mark.asyncio
async def test_parameters_are_provided_to_task(
self, original_task_function: Callable, task_config: TaskConfig, mocked_job_with_adapter: Job
self, original_task_function: Callable, task_config: TaskConfig, mocked_job_with_adapter: Job
):
mocked_job_with_adapter.variables = {"x": 1}
job_handler = task_builder.build_job_handler(original_task_function, task_config)
Expand All @@ -94,7 +94,7 @@ async def test_parameters_are_provided_to_task(

@pytest.mark.asyncio
async def test_variables_are_added_to_result(
self, original_task_function: Callable, task_config: TaskConfig, mocked_job_with_adapter: Job
self, original_task_function: Callable, task_config: TaskConfig, mocked_job_with_adapter: Job
):
original_task_function.return_value = {"x": 1}
job_handler = task_builder.build_job_handler(original_task_function, task_config)
Expand All @@ -105,7 +105,7 @@ async def test_variables_are_added_to_result(

@pytest.mark.asyncio
async def test_job_variables_are_not_overridden(
self, original_task_function: Callable, task_config: TaskConfig, mocked_job_with_adapter: Job
self, original_task_function: Callable, task_config: TaskConfig, mocked_job_with_adapter: Job
):
mocked_job_with_adapter.variables = {"x": 1}
job_handler = task_builder.build_job_handler(original_task_function, task_config)
Expand All @@ -116,7 +116,7 @@ async def test_job_variables_are_not_overridden(

@pytest.mark.asyncio
async def test_complete_job_called(
self, original_task_function: Callable, task_config: TaskConfig, mocked_job_with_adapter: Job
self, original_task_function: Callable, task_config: TaskConfig, mocked_job_with_adapter: Job
):
job_handler = task_builder.build_job_handler(original_task_function, task_config)

Expand All @@ -126,7 +126,7 @@ async def test_complete_job_called(

@pytest.mark.asyncio
async def test_returned_task_runs_original_function(
self, original_task_function: Callable, task_config: TaskConfig, mocked_job_with_adapter: Job
self, original_task_function: Callable, task_config: TaskConfig, mocked_job_with_adapter: Job
):
job_handler = task_builder.build_job_handler(original_task_function, task_config)

Expand All @@ -136,11 +136,11 @@ async def test_returned_task_runs_original_function(

@pytest.mark.asyncio
async def test_before_decorator_called(
self,
original_task_function: Callable,
decorator: TaskDecorator,
task_config: TaskConfig,
mocked_job_with_adapter: Job,
self,
original_task_function: Callable,
decorator: TaskDecorator,
task_config: TaskConfig,
mocked_job_with_adapter: Job,
):
task_config.before.append(decorator)
job_handler = task_builder.build_job_handler(original_task_function, task_config)
Expand All @@ -151,11 +151,11 @@ async def test_before_decorator_called(

@pytest.mark.asyncio
async def test_after_decorator_called(
self,
original_task_function: Callable,
decorator: TaskDecorator,
task_config: TaskConfig,
mocked_job_with_adapter: Job,
self,
original_task_function: Callable,
decorator: TaskDecorator,
task_config: TaskConfig,
mocked_job_with_adapter: Job,
):
task_config.after.append(decorator)
job_handler = task_builder.build_job_handler(original_task_function, task_config)
Expand All @@ -166,11 +166,11 @@ async def test_after_decorator_called(

@pytest.mark.asyncio
async def test_failing_decorator_continues(
self,
original_task_function: Callable,
decorator: TaskDecorator,
task_config: TaskConfig,
mocked_job_with_adapter: Job,
self,
original_task_function: Callable,
decorator: TaskDecorator,
task_config: TaskConfig,
mocked_job_with_adapter: Job,
):
decorator.side_effect = Exception()
task_config.before.append(decorator)
Expand All @@ -183,11 +183,11 @@ async def test_failing_decorator_continues(

@pytest.mark.asyncio
async def test_decorator_variables_are_added(
self,
original_task_function: Callable,
decorator: TaskDecorator,
task_config: TaskConfig,
mocked_job_with_adapter: Job,
self,
original_task_function: Callable,
decorator: TaskDecorator,
task_config: TaskConfig,
mocked_job_with_adapter: Job,
):
mocked_job_with_adapter.variables = {"x": 2}
decorator_return_value = mocked_job_with_adapter
Expand Down

0 comments on commit a1f1707

Please sign in to comment.