@davoodmehraban89 / Aram / commits / 36bf247
Fork 0

test(mapping): drop independent proposal table before protected parent fixture teardown

davoodmehraban89 committed Oct 30, 2026 at 19:34 UTC 36bf247da92750eb262cbf3fe464f3eb538b4a95
1 file changed +7 -1
backend/tests/test_mapping_draft_store.py
+7 -1
@@ -30,7 +30,13 @@ def setup(session):
30 )
31 session.add_all([note1, note2, account])
32 session.commit()
33 - return session, year, note1, note2
33 + try:
34 + yield session, year, note1, note2
35 + finally:
36 + # This table deliberately lives outside Base.metadata. It MUST be
37 + # removed before the outer session fixture drops FiscalYear tables.
38 + session.rollback()
39 + mapping_review_drafts.drop(session.get_bind())
40
41
42 def proposal(session, year, note, key="cash"):