Skip to content

Commit

Permalink
Resolve core unit test internal warning (#38835)
Browse files Browse the repository at this point in the history
* Resolve core unit test internal warning

* add back test_impersonation_subdag into deprecations_ignore.yml
  • Loading branch information
Owen-CH-Leung authored Apr 9, 2024
1 parent b14dc6b commit df4ce54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 5 additions & 5 deletions tests/core/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ def test_externally_triggered_dagrun(self, dag_maker):

with dag_maker(schedule=timedelta(weeks=1)):
task = EmptyOperator(task_id="test_externally_triggered_dag_context")
dag_maker.create_dagrun(
dr = dag_maker.create_dagrun(
run_type=DagRunType.SCHEDULED,
execution_date=execution_date,
external_trigger=True,
)
task.run(start_date=execution_date, end_date=execution_date)

ti = TI(task=task, execution_date=execution_date)
ti = TI(task=task, run_id=dr.run_id)
context = ti.get_template_context()

# next_ds should be the execution date for manually triggered runs
Expand All @@ -169,14 +169,14 @@ def test_dag_params_and_task_params(self, dag_maker):
params={"key_2": "value_2_new", "key_3": "value_3"},
)
task2 = EmptyOperator(task_id="task2")
dag_maker.create_dagrun(
dr = dag_maker.create_dagrun(
run_type=DagRunType.SCHEDULED,
external_trigger=True,
)
task1.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
task2.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE)
ti1 = TI(task=task1, execution_date=DEFAULT_DATE)
ti2 = TI(task=task2, execution_date=DEFAULT_DATE)
ti1 = TI(task=task1, run_id=dr.run_id)
ti2 = TI(task=task2, run_id=dr.run_id)
context1 = ti1.get_template_context()
context2 = ti2.get_template_context()

Expand Down
2 changes: 0 additions & 2 deletions tests/deprecations_ignore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@


# Core
- tests/core/test_core.py::TestCore::test_dag_params_and_task_params
- tests/core/test_core.py::TestCore::test_externally_triggered_dagrun
- tests/core/test_impersonation_tests.py::TestImpersonation::test_impersonation_subdag
- tests/core/test_stats.py::TestCustomStatsName::test_does_not_send_stats_using_statsd_when_the_name_is_not_valid
- tests/core/test_stats.py::TestCustomStatsName::test_does_send_stats_using_statsd_when_the_name_is_valid
Expand Down

0 comments on commit df4ce54

Please sign in to comment.