vincbeck commented on code in PR #40285:
URL: https://github.com/apache/airflow/pull/40285#discussion_r1643476741
##########
tests/jobs/test_backfill_job.py:
##########
@@ -139,14 +167,14 @@ def test_unfinished_dag_runs_set_to_failed(self,
dag_maker):
assert State.FAILED == dag_run.state
- def test_dag_run_with_finished_tasks_set_to_success(self, dag_maker):
+ def test_dag_run_with_finished_tasks_set_to_success(self, dag_maker,
mock_executor):
Review Comment:
It feels weird to specify a fixture and not using it directly, just to using
it for its mock. So maybe define an additional fixture called `mock_job`?
##########
tests/jobs/test_backfill_job.py:
##########
@@ -694,20 +712,21 @@ def test_backfill_run_rescheduled(self, dag_maker):
ti.refresh_from_db()
ti.set_state(State.UP_FOR_RESCHEDULE)
- job = Job(executor=executor)
- job_runner = BackfillJobRunner(
- job=job,
- dag=dag,
- start_date=DEFAULT_DATE,
- end_date=DEFAULT_DATE + datetime.timedelta(days=2),
- rerun_failed_tasks=True,
- )
- run_job(job=job, execute_callable=job_runner._execute)
- ti = TI(task=dag.get_task("test_backfill_run_rescheduled_task-1"),
run_id=DEFAULT_DAG_RUN_ID)
- ti.refresh_from_db()
- assert ti.state == State.SUCCESS
+ for _ in self._mock_executor():
Review Comment:
Why the for loop?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]