From de527c485efb5b15c60a5bbb3fe3636dd7daf70d Mon Sep 17 00:00:00 2001 From: C1-BA-B1-F3 Date: Sat, 3 Oct 2026 16:26:22 +0800 Subject: [PATCH] test(dblog): clear process-instance table in setUp for test isolation test_db_content asserts the process-instance table is empty, but other tests may have left rows there, making the result order-dependent. Delete all rows in setUp so the test passes whether run alone or after other tests. Fixes #679 --- tests/test_dblog.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_dblog.py b/tests/test_dblog.py index d3707b52b..91b99d2c8 100644 --- a/tests/test_dblog.py +++ b/tests/test_dblog.py @@ -19,6 +19,12 @@ class DBLogTest(TestBase): def setUp(self): super().setUp() self.database = configuration.get_config_value('logging', 'database') + # Ensure a clean slate: other tests may have left rows in the + # process-instance table, which would make the content assertions + # below fail when the suite runs in a different order. + session = get_session() + session.query(ProcessInstance).delete() + session.commit() def test_0_dblog(self): """Test pywps.formats.Format class