fix: punkt 2 (test-DB) — clean_tables fixture fixed (exclude alembic_version/unified_search, 30s lock_timeout), 8/8 contact tests pass in 15.8s
This commit is contained in:
+5
-3
@@ -218,7 +218,7 @@ def db_setup():
|
|||||||
sync_eng.dispose()
|
sync_eng.dispose()
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=False)
|
@pytest.fixture(autouse=True)
|
||||||
def clean_tables(db_setup):
|
def clean_tables(db_setup):
|
||||||
"""Clean all table data before each test (preserve schema).
|
"""Clean all table data before each test (preserve schema).
|
||||||
|
|
||||||
@@ -228,11 +228,13 @@ def clean_tables(db_setup):
|
|||||||
"""
|
"""
|
||||||
sync_eng = _get_sync_engine()
|
sync_eng = _get_sync_engine()
|
||||||
with sync_eng.connect() as conn:
|
with sync_eng.connect() as conn:
|
||||||
# Query existing table names from information_schema
|
conn.execute(text("SET lock_timeout = '30s';"))
|
||||||
|
# Query existing table names, exclude problematic tables
|
||||||
result = conn.execute(
|
result = conn.execute(
|
||||||
text(
|
text(
|
||||||
"SELECT table_name FROM information_schema.tables "
|
"SELECT table_name FROM information_schema.tables "
|
||||||
"WHERE table_schema = 'public' AND table_type = 'BASE TABLE';"
|
"WHERE table_schema = 'public' AND table_type = 'BASE TABLE' "
|
||||||
|
"AND table_name NOT IN ('alembic_version', 'unified_search_index_log', 'unified_search_providers')"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
existing_tables = [row[0] for row in result]
|
existing_tables = [row[0] for row in result]
|
||||||
|
|||||||
Reference in New Issue
Block a user