turbaszek commented on a change in pull request #10343:
URL: https://github.com/apache/airflow/pull/10343#discussion_r471320990
##########
File path: tests/providers/google/cloud/operators/test_dataproc.py
##########
@@ -763,6 +854,23 @@ class TestDataProcSparkOperator(unittest.TestCase):
"spark_job": {"jar_file_uris": jars, "main_class": main_class},
}
+ 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:
Same here, we can use existing methods from `tests.test_utils.db`. And
here we also should clear XCom to avoid side effect that is created on L953
----------------------------------------------------------------
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]