diff test/db_test_base.py @ 7907:aa32e3535766

issue2551334 - get test suite running under windows Make sure to close session and otk databases in tearDown so that test directory can be removed.
author John Rouillard <rouilj@ieee.org>
date Sat, 27 Apr 2024 23:21:29 -0400
parents 2184033114a0
children ecf0368a05da
line wrap: on
line diff
--- a/test/db_test_base.py	Sat Apr 27 23:19:51 2024 -0400
+++ b/test/db_test_base.py	Sat Apr 27 23:21:29 2024 -0400
@@ -160,7 +160,11 @@
 class MyTestCase(object):
     def tearDown(self):
         if hasattr(self, 'db'):
-            self.db.close()
+          if hasattr(self.db, 'session'):
+            self.db.session.db.close()
+          if hasattr(self.db, 'otk'):
+            self.db.otk.db.close()
+          self.db.close()
         if os.path.exists(config.DATABASE):
             shutil.rmtree(config.DATABASE)
 

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