Skip to content

Commit

Permalink
Move cloned entries declaration out of raise assertion scope
Browse files Browse the repository at this point in the history
Signed-off-by: Hai Nguyen <[email protected]>
  • Loading branch information
sudohainguyen authored and eladkal committed Mar 18, 2024
1 parent 0d4ae03 commit 21f4e9a
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,28 +77,29 @@ def test_spark_job_spec_dynamicAllocation_enabled_with_invalid_config(self):
"executor": {},
}
}

cloned_entries = entries.copy()
cloned_entries["spec"]["dynamicAllocation"]["initialExecutors"] = None
with pytest.raises(
AirflowException,
match="Make sure initial/min/max value for dynamic allocation is passed",
):
cloned_entries = entries.copy()
cloned_entries["spec"]["dynamicAllocation"]["initialExecutors"] = None
SparkJobSpec(**cloned_entries)

cloned_entries = entries.copy()
cloned_entries["spec"]["dynamicAllocation"]["minExecutors"] = None
with pytest.raises(
AirflowException,
match="Make sure initial/min/max value for dynamic allocation is passed",
):
cloned_entries = entries.copy()
cloned_entries["spec"]["dynamicAllocation"]["minExecutors"] = None
SparkJobSpec(**cloned_entries)

cloned_entries = entries.copy()
cloned_entries["spec"]["dynamicAllocation"]["maxExecutors"] = None
with pytest.raises(
AirflowException,
match="Make sure initial/min/max value for dynamic allocation is passed",
):
cloned_entries = entries.copy()
cloned_entries["spec"]["dynamicAllocation"]["maxExecutors"] = None
SparkJobSpec(**cloned_entries)


Expand Down

0 comments on commit 21f4e9a

Please sign in to comment.