[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/StartUp/tests - testStartupDirectives.py:1.5
Jeremy Hylton
jeremy@zope.com
Fri, 20 Dec 2002 14:46:46 -0500
Update of /cvs-repository/Zope3/lib/python/Zope/App/StartUp/tests
In directory cvs.zope.org:/tmp/cvs-serv13713
Modified Files:
testStartupDirectives.py
Log Message:
Close the database in testInitDB, preventing file lock problems on
Windows.
=== Zope3/lib/python/Zope/App/StartUp/tests/testStartupDirectives.py 1.4 => 1.5 ===
--- Zope3/lib/python/Zope/App/StartUp/tests/testStartupDirectives.py:1.4 Thu Dec 19 18:05:22 2002
+++ Zope3/lib/python/Zope/App/StartUp/tests/testStartupDirectives.py Fri Dec 20 14:46:46 2002
@@ -95,7 +95,6 @@
self.assertEqual(server_info['port'], 8081)
self.assertEqual(server_info['verbose'], 1)
-
def testInitDB(self):
sd = self._createBlankSiteDefinition()
@@ -112,12 +111,14 @@
sd._initDB()
- connection = sd._zodb.open()
- root = connection.root()
- app = root.get(ZopePublication.root_name, None)
- connection.close()
- self.failUnless(IRootFolder.isImplementedBy(app))
-
+ try:
+ connection = sd._zodb.open()
+ root = connection.root()
+ app = root.get(ZopePublication.root_name, None)
+ connection.close()
+ self.failUnless(IRootFolder.isImplementedBy(app))
+ finally:
+ sd.close()
def test_suite():
loader=unittest.TestLoader()