diff test/test_indexer.py @ 7904:94aafe3b0a0d

issue2551334 - get more tests working under windows Fix indexer tests for file based db's running under windows. Apparently if there is an open/uncommitted cursor sqlite3db.close() doesn't actually close the file under windows. Because these tests run isolated indexer functions, the commits aren't done in the code under test.
author John Rouillard <rouilj@ieee.org>
date Thu, 25 Apr 2024 18:34:37 -0400
parents 5be92f16a684
children
line wrap: on
line diff
--- a/test/test_indexer.py	Sun Apr 21 21:50:36 2024 -0400
+++ b/test/test_indexer.py	Thu Apr 25 18:34:37 2024 -0400
@@ -374,6 +374,10 @@
         self.dex = Indexer(self.db)
     def tearDown(self):
         if hasattr(self, 'db'):
+            # commit any outstanding cursors.
+            # close() doesn't actually close file handle on
+            #    windows unless commit() is called.
+            self.db.commit()
             self.db.close()
         if os.path.exists(config.DATABASE):
             shutil.rmtree(config.DATABASE)

Roundup Issue Tracker: http://roundup-tracker.org/