Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/cli/commands/test_task_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ def test_run_task_with_pool(self):
session.commit()

assert session.query(TaskInstance).filter_by(pool=pool_name).first() is None
task_command.task_run(self.parser.parse_args(self.task_args + ["--pool", pool_name]))
task_command.task_run(self.parser.parse_args([*self.task_args, "--pool", pool_name]))
assert session.query(TaskInstance).filter_by(pool=pool_name).first() is not None

session.delete(pool)
Expand Down
2 changes: 1 addition & 1 deletion tests/dag_processing/test_job_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ def test_add_new_file_to_parsing_queue(
["file_3.py", "file_2.py", "file_1.py"]
)

manager.processor.set_file_paths(dag_files + ["file_4.py"])
manager.processor.set_file_paths([*dag_files, "file_4.py"])
manager.processor.add_new_file_path_to_queue()
assert manager.processor._file_path_queue == collections.deque(
["file_4.py", "file_3.py", "file_2.py", "file_1.py"]
Expand Down
12 changes: 6 additions & 6 deletions tests/providers/amazon/aws/hooks/test_eks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,15 +1170,15 @@ def test_create_fargate_selectors(self, cluster_builder, selectors, expected_mes

test_inputs = dict(
deepcopy(
# Required Constants
[POD_EXECUTION_ROLE_ARN]
# Required Variables
+ [
[
# Required Constants
POD_EXECUTION_ROLE_ARN,
# Required Variables
(ClusterAttributes.CLUSTER_NAME, cluster_name),
(FargateProfileAttributes.FARGATE_PROFILE_NAME, fargate_profile_name),
# Test Case Values
(FargateProfileAttributes.SELECTORS, selectors),
]
# Test Case Values
+ [(FargateProfileAttributes.SELECTORS, selectors)]
)
)

Expand Down
2 changes: 1 addition & 1 deletion tests/providers/google/cloud/operators/test_datafusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def test_execute_check_hook_call_should_execute_successfully(self, mock_hook):
)

mock_hook.return_value.wait_for_pipeline_state.assert_called_once_with(
success_states=SUCCESS_STATES + [PipelineStates.RUNNING],
success_states=[*SUCCESS_STATES, PipelineStates.RUNNING],
pipeline_id=PIPELINE_ID,
pipeline_name=PIPELINE_NAME,
namespace=NAMESPACE,
Expand Down
16 changes: 10 additions & 6 deletions tests/providers/google/cloud/operators/test_dataproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,8 @@ def test_execute(self, mock_hook, to_dict_mock):
"labels": LABELS,
"virtual_cluster_config": None,
}
expected_calls = self.extra_links_expected_calls_base + [
expected_calls = [
*self.extra_links_expected_calls_base,
call.hook().create_cluster(**create_cluster_args),
]

Expand Down Expand Up @@ -523,7 +524,8 @@ def test_execute_in_gke(self, mock_hook, to_dict_mock):
"labels": LABELS,
"virtual_cluster_config": VIRTUAL_CLUSTER_CONFIG,
}
expected_calls = self.extra_links_expected_calls_base + [
expected_calls = [
*self.extra_links_expected_calls_base,
call.hook().create_cluster(**create_cluster_args),
]

Expand Down Expand Up @@ -811,8 +813,9 @@ def test_execute(self, mock_hook):
"graceful_decommission_timeout": {"seconds": 600},
"update_mask": UPDATE_MASK,
}
expected_calls = self.extra_links_expected_calls_base + [
call.hook().update_cluster(**update_cluster_args)
expected_calls = [
*self.extra_links_expected_calls_base,
call.hook().update_cluster(**update_cluster_args),
]

op = DataprocScaleClusterOperator(
Expand Down Expand Up @@ -1256,8 +1259,9 @@ def test_execute(self, mock_hook):
"timeout": TIMEOUT,
"metadata": METADATA,
}
expected_calls = self.extra_links_expected_calls_base + [
call.hook().update_cluster(**update_cluster_args)
expected_calls = [
*self.extra_links_expected_calls_base,
call.hook().update_cluster(**update_cluster_args),
]

op = DataprocUpdateClusterOperator(
Expand Down
4 changes: 2 additions & 2 deletions tests/serialization/test_dag_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,7 @@ class DummyTriggerRule(BaseTIDep):
pass

class DummyTask(BaseOperator):
deps = frozenset(list(BaseOperator.deps) + [DummyTriggerRule()])
deps = frozenset([*BaseOperator.deps, DummyTriggerRule()])

execution_date = datetime(2020, 1, 1)
with DAG(dag_id="test_error_on_unregistered_ti_dep_serialization", start_date=execution_date) as dag:
Expand All @@ -1499,7 +1499,7 @@ def test_serialize_and_deserialize_custom_ti_deps(self):
from test_plugin import CustomTestTriggerRule

class DummyTask(BaseOperator):
deps = frozenset(list(BaseOperator.deps) + [CustomTestTriggerRule()])
deps = frozenset([*BaseOperator.deps, CustomTestTriggerRule()])

execution_date = datetime(2020, 1, 1)
with DAG(dag_id="test_serialize_custom_ti_deps", start_date=execution_date) as dag:
Expand Down
4 changes: 2 additions & 2 deletions tests/utils/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ def test_chunks(self):
assert list(helpers.chunks([1, 2, 3], 2)) == [[1, 2], [3]]

def test_reduce_in_chunks(self):
assert helpers.reduce_in_chunks(lambda x, y: x + [y], [1, 2, 3, 4, 5], []) == [[1, 2, 3, 4, 5]]
assert helpers.reduce_in_chunks(lambda x, y: [*x, y], [1, 2, 3, 4, 5], []) == [[1, 2, 3, 4, 5]]

assert helpers.reduce_in_chunks(lambda x, y: x + [y], [1, 2, 3, 4, 5], [], 2) == [[1, 2], [3, 4], [5]]
assert helpers.reduce_in_chunks(lambda x, y: [*x, y], [1, 2, 3, 4, 5], [], 2) == [[1, 2], [3, 4], [5]]

assert helpers.reduce_in_chunks(lambda x, y: x + y[0] * y[1], [1, 2, 3, 4], 0, 2) == 14

Expand Down
2 changes: 1 addition & 1 deletion tests/utils/test_python_virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def test_pip_install_options(self, mock_execute_in_subprocess):
[sys.executable, "-m", "virtualenv", "/VENV", "--system-site-packages", "--python=pythonVER"]
)
mock_execute_in_subprocess.assert_called_with(
["/VENV/bin/pip", "install"] + pip_install_options + ["apache-beam[gcp]"]
["/VENV/bin/pip", "install", *pip_install_options, "apache-beam[gcp]"]
)

@mock.patch("airflow.utils.python_virtualenv.execute_in_subprocess")
Expand Down