turbaszek commented on a change in pull request #10343:
URL: https://github.com/apache/airflow/pull/10343#discussion_r471318268



##########
File path: tests/providers/google/cloud/operators/test_dataproc.py
##########
@@ -419,6 +428,24 @@ def test_execute(self, mock_hook):
 
 
 class TestDataprocSubmitJobOperator(unittest.TestCase):
+
+    def setUp(self):
+        self.dagbag = DagBag(
+            dag_folder='/dev/null', include_examples=False
+        )
+        self.dag = DAG(TEST_DAG_ID, default_args={
+            'owner': 'airflow',
+            'start_date': DEFAULT_DATE
+        })
+        self.mock_context = MagicMock()
+
+    def tearDown(self):
+        session = Session()
+        session.query(TaskInstance).filter_by(
+            dag_id=TEST_DAG_ID).delete()
+        session.commit()
+        session.close()

Review comment:
       And we can use `tests.tests_utils.db.clear_db_runs` (and `clear_db_xcom` 
as we push something to XCom) instead duplicating the logic




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