feng-tao commented on a change in pull request #4396: [AIRFLOW-3585] - Add 
edges to database
URL: https://github.com/apache/airflow/pull/4396#discussion_r256958070
 
 

 ##########
 File path: tests/sensors/test_base_sensor.py
 ##########
 @@ -60,12 +61,12 @@ def setUp(self):
             'start_date': DEFAULT_DATE
         }
         self.dag = DAG(TEST_DAG_ID, default_args=args)
+        self.dag.sync_to_db()
 
-        session = settings.Session()
-        session.query(TaskReschedule).delete()
-        session.query(DagRun).delete()
-        session.query(TaskInstance).delete()
-        session.commit()
+        with create_session() as session:
+            session.query(TaskReschedule).delete()
+            session.query(DagRun).delete()
+            session.query(TaskInstance).delete()
 
 Review comment:
   who handles the commit? Is the context_manager for create_session handling 
the commit in __exit__ ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to