Skip to content

Commit

Permalink
make sure we close the db we open
Browse files Browse the repository at this point in the history
A test intentionally causes an exception to be raised and this was
causing tearDown to fail on windows.
  • Loading branch information
jimfulton committed Apr 8, 2017
1 parent af9bb74 commit d16797c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/ZODB/tests/testConfig.py
Expand Up @@ -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):
Expand Down

0 comments on commit d16797c

Please sign in to comment.