Skip to content

Commit 0b4f3fc

Browse files
author
TheoS
committed
Made the test more explicit
1 parent bf4d7fe commit 0b4f3fc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

airflow-core/tests/unit/models/test_dagrun.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,17 +510,17 @@ def on_failure_callable(context):
510510
serialized_dag = dr.get_dag()
511511

512512
with mock.patch.object(dr, "execute_dag_callbacks") as execute_dag_callbacks:
513-
_, callback = dr.update_state()
513+
_, callback = dr.update_state(execute_callbacks=True)
514514
assert execute_dag_callbacks.mock_calls == [
515515
mock.call(dag=serialized_dag, success=False, relevant_ti=ti_middle, reason="all_tasks_deadlocked")
516516
]
517-
# Make sure the correct TI is passed on timeout
517+
# Make sure the correct TI is passed on deadlock
518518
call_args = execute_dag_callbacks.call_args
519519
ti_passed = call_args.kwargs["relevant_ti"]
520520
assert ti_passed.task_id == "wrong"
521521

522522
assert dr.state == DagRunState.FAILED
523-
# Callbacks are not added until handle_callback = False is passed to dag_run.update_state()
523+
# Callbacks is None as execute_callbacks=True
524524
assert callback is None
525525

526526
def test_on_success_callback_when_task_skipped(self, session, testing_dag_bundle):

0 commit comments

Comments
 (0)