Skip to content

Commit d985cb6

Browse files
JasonKChowfacebook-github-bot
authored andcommitted
Ensure dbs tests don't leave hanging temporary files (#796)
Summary: Pull Request resolved: #796 Extra read only databases were leaving temporary resources hanging and not cleaning up. Fixed to ensure they are manually handled. Reviewed By: tymmsc Differential Revision: D74211454 fbshipit-source-id: 01ce2c77b5b1443d86a0deba5c4ecae17a680ea2
1 parent 2935332 commit d985cb6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/test_db.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,8 @@ def test_get_dataframe_extra_data(self):
648648
np.testing.assert_equal(df.iloc[0]["trial_number"], np.nan)
649649
self.assertEqual(df.iloc[1]["trial_number"], 2)
650650

651+
extra_info_data.cleanup()
652+
651653
def test_combine_dbs_list(self):
652654
"""Test the combine_dbs function with a list of database paths."""
653655
# Get paths to existing test databases
@@ -693,6 +695,8 @@ def test_combine_dbs_list(self):
693695
"single_stimuli.db" in origin_db or "extra_info.db" in origin_db
694696
)
695697

698+
combined_db.cleanup()
699+
696700

697701
if __name__ == "__main__":
698702
unittest.main()

0 commit comments

Comments
 (0)