comparison 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
comparison
equal deleted inserted replaced
7903:7d621b3ba8ba 7904:94aafe3b0a0d
372 shutil.rmtree(config.DATABASE) 372 shutil.rmtree(config.DATABASE)
373 self.db = self.module.Database(config, 'admin') 373 self.db = self.module.Database(config, 'admin')
374 self.dex = Indexer(self.db) 374 self.dex = Indexer(self.db)
375 def tearDown(self): 375 def tearDown(self):
376 if hasattr(self, 'db'): 376 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()
377 self.db.close() 381 self.db.close()
378 if os.path.exists(config.DATABASE): 382 if os.path.exists(config.DATABASE):
379 shutil.rmtree(config.DATABASE) 383 shutil.rmtree(config.DATABASE)
380 384
381 385

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