uranusjr commented on a change in pull request #18141:
URL: https://github.com/apache/airflow/pull/18141#discussion_r706332036



##########
File path: tests/jobs/test_scheduler_job.py
##########
@@ -1669,22 +1668,24 @@ def test_scheduler_keeps_scheduling_pool_full(self, 
dag_maker):
         with dag_maker(
             dag_id='test_scheduler_keeps_scheduling_pool_full_d1',
             start_date=DEFAULT_DATE,
-        ) as dag_d1:
+        ):
             BashOperator(
                 task_id='test_scheduler_keeps_scheduling_pool_full_t1',
                 pool='test_scheduler_keeps_scheduling_pool_full_p1',
                 bash_command='echo hi',
             )
+        dag_d1 = dag_maker.dag

Review comment:
       For some reason if you use `dag_maker` more than once, the `as` 
variables are binded to the same DAG:
   
   ```python
   with dag_maker(...) as dag1:
       ...
   
   with dag_maker(...) as dag2:
       ...
   
   assert dag1 is dag2  # True!
   ```
   
   I don't understand how this could happen, maybe there's some Pytest magic 
involved, but this is the easiest workaround anyway so I just did it instead of 
going down the rabbit hole.




-- 
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]


Reply via email to