Skip to content

Commit 95517d8

Browse files
committed
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.
1 parent 58e6b6b commit 95517d8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/test_indexer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,10 @@ def setUp(self):
374374
self.dex = Indexer(self.db)
375375
def tearDown(self):
376376
if hasattr(self, 'db'):
377+
# commit any outstanding cursors.
378+
# close() doesn't actually close file handle on
379+
# windows unless commit() is called.
380+
self.db.commit()
377381
self.db.close()
378382
if os.path.exists(config.DATABASE):
379383
shutil.rmtree(config.DATABASE)

0 commit comments

Comments
 (0)