uranusjr commented on a change in pull request #20881:
URL: https://github.com/apache/airflow/pull/20881#discussion_r786649388
##########
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:
Oops, now it’s not cleaning up enough. Since the tests trigger DAGs,
cleanup should still happen in `teardown_method`, not `teardown_class`. This
way, cleanup happens once before any tests a run (`setup_class`), and once
after _each_ test (`teardown_method`).
--
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]