vincbeck commented on code in PR #44456:
URL: https://github.com/apache/airflow/pull/44456#discussion_r1866617827
##########
tests/dag_processing/test_collection.py:
##########
@@ -62,3 +76,57 @@ def test_statement_latest_runs_many_dag():
"WHERE dag_run.dag_id = anon_1.dag_id AND dag_run.logical_date =
anon_1.max_logical_date",
]
assert actual == expected, compiled_stmt
+
+
[email protected]_test
+class TestAssetModelOperation:
+ @staticmethod
+ def clean_db():
+ clear_db_dags()
+ clear_db_assets()
+ clear_db_triggers()
+
+ @pytest.fixture(autouse=True)
+ def per_test(self) -> Generator:
+ self.clean_db()
+ yield
+ self.clean_db()
Review Comment:
In most cases yes but if there are some stale resources from other tests
that do not clean up resources properly. Or maybe other situation. I followed
what is being done in other tests so I am just assuming the reasons here :)
Nevertheless I think it makes sense to do it before to prepare a clean
environment (so that other resources cannot conflict with the ones being
tested) and after to delete the resources we created during 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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]