diff --git a/tests/cli/commands/test_task_command.py b/tests/cli/commands/test_task_command.py index c7937fa93fefa..19100bb5afe54 100644 --- a/tests/cli/commands/test_task_command.py +++ b/tests/cli/commands/test_task_command.py @@ -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) diff --git a/tests/dag_processing/test_job_runner.py b/tests/dag_processing/test_job_runner.py index 8189c9a219786..481b740ca68b2 100644 --- a/tests/dag_processing/test_job_runner.py +++ b/tests/dag_processing/test_job_runner.py @@ -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"] diff --git a/tests/providers/amazon/aws/hooks/test_eks.py b/tests/providers/amazon/aws/hooks/test_eks.py index 6b841e78c6549..d842a69a61145 100644 --- a/tests/providers/amazon/aws/hooks/test_eks.py +++ b/tests/providers/amazon/aws/hooks/test_eks.py @@ -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)] ) ) diff --git a/tests/providers/google/cloud/operators/test_datafusion.py b/tests/providers/google/cloud/operators/test_datafusion.py index 2950fceb7d78c..fd5ed2d648dd4 100644 --- a/tests/providers/google/cloud/operators/test_datafusion.py +++ b/tests/providers/google/cloud/operators/test_datafusion.py @@ -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, diff --git a/tests/providers/google/cloud/operators/test_dataproc.py b/tests/providers/google/cloud/operators/test_dataproc.py index 923a7abae68c9..40180d4b47881 100644 --- a/tests/providers/google/cloud/operators/test_dataproc.py +++ b/tests/providers/google/cloud/operators/test_dataproc.py @@ -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), ] @@ -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), ] @@ -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( @@ -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( diff --git a/tests/serialization/test_dag_serialization.py b/tests/serialization/test_dag_serialization.py index 5338579e01044..5485ae4ea8edd 100644 --- a/tests/serialization/test_dag_serialization.py +++ b/tests/serialization/test_dag_serialization.py @@ -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: @@ -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: diff --git a/tests/utils/test_helpers.py b/tests/utils/test_helpers.py index c3c370060a665..46462c30d12b7 100644 --- a/tests/utils/test_helpers.py +++ b/tests/utils/test_helpers.py @@ -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 diff --git a/tests/utils/test_python_virtualenv.py b/tests/utils/test_python_virtualenv.py index ea11f979d74df..9f1385b61e794 100644 --- a/tests/utils/test_python_virtualenv.py +++ b/tests/utils/test_python_virtualenv.py @@ -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")