Mercurial > p > roundup > code
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 7906:470616e64414 | 7907:aa32e3535766 |
|---|---|
| 158 db.security.addPermissionToRole("User", v1) | 158 db.security.addPermissionToRole("User", v1) |
| 159 | 159 |
| 160 class MyTestCase(object): | 160 class MyTestCase(object): |
| 161 def tearDown(self): | 161 def tearDown(self): |
| 162 if hasattr(self, 'db'): | 162 if hasattr(self, 'db'): |
| 163 self.db.close() | 163 if hasattr(self.db, 'session'): |
| 164 self.db.session.db.close() | |
| 165 if hasattr(self.db, 'otk'): | |
| 166 self.db.otk.db.close() | |
| 167 self.db.close() | |
| 164 if os.path.exists(config.DATABASE): | 168 if os.path.exists(config.DATABASE): |
| 165 shutil.rmtree(config.DATABASE) | 169 shutil.rmtree(config.DATABASE) |
| 166 | 170 |
| 167 def open_database(self, user='admin'): | 171 def open_database(self, user='admin'): |
| 168 self.db = self.module.Database(config, user) | 172 self.db = self.module.Database(config, user) |
