khalidmammadov commented on a change in pull request #20881:
URL: https://github.com/apache/airflow/pull/20881#discussion_r786750308



##########
File path: tests/models/test_dagbag.py
##########
@@ -44,19 +44,20 @@
 from tests.test_utils import db
 from tests.test_utils.asserts import assert_queries_count
 from tests.test_utils.config import conf_vars
-from tests.test_utils.permissions import delete_dag_specific_permissions
 
 
 class TestDagBag:
     @classmethod
     def setup_class(cls):
         cls.empty_dir = mkdtemp()
+        db.clear_dag_specific_permissions()
 
     @classmethod
     def teardown_class(cls):
         shutil.rmtree(cls.empty_dir)
+        db.clear_dag_specific_permissions()
 
-    def setup_methods(self) -> None:
+    def setup_method(self) -> None:
         db.clear_db_dags()
         db.clear_db_runs()
         db.clear_db_serialized_dags()

Review comment:
       I looked into it and looks like cleaning after each method is not 
required. I have added where it's necessary to do that before starting to test 
and final teardown_class will clean up after once all complete. 
   I have run the tests and all passes with this setup.




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to