feluelle commented on a change in pull request #5057: [AIRFLOW-4257] Remove the 
global session from the core test
URL: https://github.com/apache/airflow/pull/5057#discussion_r273509943
 
 

 ##########
 File path: tests/core.py
 ##########
 @@ -116,13 +117,9 @@ def setUp(self):
 
     def tearDown(self):
         if os.environ.get('KUBERNETES_VERSION') is None:
-            session = Session()
-            session.query(models.TaskInstance).filter_by(
-                dag_id=TEST_DAG_ID).delete()
-            session.query(TaskFail).filter_by(
-                dag_id=TEST_DAG_ID).delete()
-            session.commit()
-            session.close()
+            with create_session() as session:
 
 Review comment:
   How about `provide_session` annotation instead of `create_session` ?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to