You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/08/05 09:37:07 UTC

[GitHub] [airflow] ashb commented on a change in pull request #17265: Use `dag_maker` fixture in test_scheduler_job.py

ashb commented on a change in pull request #17265:
URL: https://github.com/apache/airflow/pull/17265#discussion_r683294385



##########
File path: tests/jobs/test_scheduler_job.py
##########
@@ -495,45 +439,24 @@ def test_find_executable_task_instances_pool(self):
         assert tis[3].key in res_keys
         session.rollback()
 
-    def test_find_executable_task_instances_order_execution_date(self):
+    def test_find_executable_task_instances_order_execution_date(self, dag_maker):
         dag_id_1 = 'SchedulerJobTest.test_find_executable_task_instances_order_execution_date-a'
         dag_id_2 = 'SchedulerJobTest.test_find_executable_task_instances_order_execution_date-b'
         task_id = 'task-a'
-        dag_1 = DAG(dag_id=dag_id_1, start_date=DEFAULT_DATE, max_active_tasks=16)
-        dag_2 = DAG(dag_id=dag_id_2, start_date=DEFAULT_DATE, max_active_tasks=16)
-        dag1_task = DummyOperator(dag=dag_1, task_id=task_id)
-        dag2_task = DummyOperator(dag=dag_2, task_id=task_id)
+        with dag_maker(dag_id=dag_id_1, max_active_tasks=16) as dag_1:
+            dag1_task = DummyOperator(task_id=task_id)
+        dr1 = dag_maker.create_dagrun(execution_date=DEFAULT_DATE + timedelta(hours=1))

Review comment:
       It may not be relevant, but why does the execution_date change here?




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org