DB - Fix session handling for context method#185
Conversation
The `db_session_with_credentials` helper method did not properly close the active session once a query was executed. This method was first used in the snowex_db library and caused tests to hang when trying to tear down test data between class runs.
Pytest 8.4 has an interface change that breaks compatibility with factory-boy<4
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-0.6.x #185 +/- ##
=================================================
+ Coverage 75.80% 75.92% +0.11%
=================================================
Files 21 21
Lines 649 652 +3
=================================================
+ Hits 492 495 +3
Misses 157 157 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
aaarendt
left a comment
There was a problem hiding this comment.
Just noting that after I run the test suite for snowex_db the entire db is dropped, whereas in snowexsql the tables remain (empty). I'm unclear on what is the preferred behavior. Wondering if there's value in unifying the db deployment for testing across both repos?
I have that on the low priority list to migrate the snowex_db test DB setup to a similar architecture. There are a couple of more differences (for example using transactions or using DB fixtures in snowexsql) that would be good to do as well in one push. |
The
db_session_with_credentialshelper method did not properly close the active session once a query was executed. This method was first used in the snowex_db library and caused tests to hang when trying to tear down test data between class runs.