diff --git a/src/ZODB/tests/testConfig.py b/src/ZODB/tests/testConfig.py index 1f22136a6..c709e66cd 100644 --- a/src/ZODB/tests/testConfig.py +++ b/src/ZODB/tests/testConfig.py @@ -33,13 +33,15 @@ def tearDown(self): def _test(self, s): db = self._opendb(s) - self.storage = db._storage - # Do something with the database to make sure it works - cn = db.open() - rt = cn.root() - rt["test"] = 1 - transaction.commit() - db.close() + try: + self.storage = db._storage + # Do something with the database to make sure it works + cn = db.open() + rt = cn.root() + rt["test"] = 1 + transaction.commit() + finally: + db.close() class ZODBConfigTest(ConfigTestBase):