[Checkins] SVN: zope.app.interface/trunk/ Fixed tests and test tearDown to actually close the DB.

Adam Groszer agroszer at gmail.com
Wed Jul 7 12:47:54 EDT 2010


Log message for revision 114290:
  Fixed tests and test tearDown to actually close the DB.

Changed:
  U   zope.app.interface/trunk/CHANGES.txt
  U   zope.app.interface/trunk/src/zope/app/interface/tests/test_interface.py

-=-
Modified: zope.app.interface/trunk/CHANGES.txt
===================================================================
--- zope.app.interface/trunk/CHANGES.txt	2010-07-07 14:33:34 UTC (rev 114289)
+++ zope.app.interface/trunk/CHANGES.txt	2010-07-07 16:47:53 UTC (rev 114290)
@@ -5,7 +5,7 @@
 3.5.1 (unreleased)
 ------------------
 
-- Nothing changed yet.
+- Fixed tests and test tearDown to actually close the DB.
 
 
 3.5.0 (2009-05-21)

Modified: zope.app.interface/trunk/src/zope/app/interface/tests/test_interface.py
===================================================================
--- zope.app.interface/trunk/src/zope/app/interface/tests/test_interface.py	2010-07-07 14:33:34 UTC (rev 114289)
+++ zope.app.interface/trunk/src/zope/app/interface/tests/test_interface.py	2010-07-07 16:47:53 UTC (rev 114290)
@@ -92,8 +92,10 @@
         transaction.commit()
 
     def tearDown(self):
+        transaction.abort() # just in case
+        self.conn.close()
+        self.db.close()
         util.tearDown(self)
-        transaction.abort() # just in case
 
     def test_creation(self):
         class IFoo(PersistentInterface):
@@ -119,7 +121,7 @@
 
     def test_provides(self):
         """Provides are persistent."""
-        
+
         self.registry.newModule("barmodule", bar_code)
         barmodule = self.registry.findModule("barmodule")
 
@@ -159,6 +161,8 @@
         blah = root['blah']
         self.assertTrue(barmodule.IBlah.providedBy(blah))
 
+        db.close()
+
     def test_persistentWeakref(self):
         """Verify interacton of declaration weak refs with ZODB
 
@@ -195,6 +199,6 @@
         transaction.commit()
         barmodule = self.registry.findModule("barmodule")
         self.assertTrue(IBarInterface.providedBy(barmodule.IBar))
-        
+
 def test_suite():
     return unittest.makeSuite(PersistentInterfaceTest)



More information about the checkins mailing list