ephraimbuddy commented on a change in pull request #9170:
URL: https://github.com/apache/airflow/pull/9170#discussion_r439765597



##########
File path: tests/api_connexion/endpoints/test_xcom_endpoint.py
##########
@@ -18,59 +18,153 @@
 
 import pytest
 
+from airflow.models import DagRun as DR, XCom
+from airflow.utils.dates import parse_execution_date
+from airflow.utils.session import create_session, provide_session
+from airflow.utils.types import DagRunType
 from airflow.www import app
 
 
-class TesXComEndpoint(unittest.TestCase):
+class TestXComEndpoint(unittest.TestCase):
     @classmethod
     def setUpClass(cls) -> None:
         super().setUpClass()
         cls.app = app.create_app(testing=True)  # type:ignore
 
     def setUp(self) -> None:
         self.client = self.app.test_client()  # type:ignore
+        # clear existing xcoms
+        with create_session() as session:
+            session.query(XCom).delete()
+            session.query(DR).delete()
 

Review comment:
       I suggest you add tearDown method so that there's no hanging Xcom and DR 
data after the tests




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


Reply via email to