[Zodb-checkins] SVN: ZODB/branches/jim-gc/src/persistent/tests/testPersistent.py Fixed test leaks.

Jim Fulton jim at zope.com
Thu Sep 23 18:39:59 EDT 2010


Log message for revision 116782:
  Fixed test leaks.
  

Changed:
  U   ZODB/branches/jim-gc/src/persistent/tests/testPersistent.py

-=-
Modified: ZODB/branches/jim-gc/src/persistent/tests/testPersistent.py
===================================================================
--- ZODB/branches/jim-gc/src/persistent/tests/testPersistent.py	2010-09-23 22:10:53 UTC (rev 116781)
+++ ZODB/branches/jim-gc/src/persistent/tests/testPersistent.py	2010-09-23 22:39:58 UTC (rev 116782)
@@ -53,6 +53,8 @@
             obj._p_oid = 12
         self.assertRaises(ValueError, setoid)
 
+        jar.close()
+
     # The value returned for _p_changed can be one of:
     # 0 -- it is not changed
     # 1 -- it is changed
@@ -70,6 +72,8 @@
         self.assertEqual(obj._p_state, CHANGED)
         self.assert_(obj in jar.registered)
 
+        jar.close()
+
     def test_setattr_then_mark_uptodate(self):
         from persistent import UPTODATE
         obj = self._makeOne()
@@ -82,6 +86,8 @@
         self.assertEqual(obj._p_changed, 0)
         self.assertEqual(obj._p_state, UPTODATE)
 
+        jar.close()
+
     def test_set_changed_directly(self):
         from persistent import CHANGED
         obj = self._makeOne()
@@ -94,6 +100,8 @@
         self.assertEqual(obj._p_state, CHANGED)
         self.assert_(obj in jar.registered)
 
+        jar.close()
+
     def test_cant_ghostify_if_changed(self):
         from persistent import CHANGED
         obj = self._makeOne()
@@ -108,6 +116,8 @@
         self.assertEqual(obj._p_changed, 1)
         self.assertEqual(obj._p_state, CHANGED)
 
+        jar.close()
+
     def test_can_ghostify_if_uptodate(self):
         from persistent import GHOST
         obj = self._makeOne()
@@ -121,6 +131,8 @@
         self.assertEqual(obj._p_changed, None)
         self.assertEqual(obj._p_state, GHOST)
 
+        jar.close()
+
     def test_can_ghostify_if_changed_but_del__p_changed(self):
         from persistent import GHOST
         obj = self._makeOne()
@@ -135,6 +147,8 @@
         self.assertEqual(obj._p_changed, None)
         self.assertEqual(obj._p_state, GHOST)
 
+        jar.close()
+
     def test__p_state_immutable(self):
         from persistent import CHANGED
         from persistent import GHOST
@@ -166,6 +180,8 @@
         self.assertEqual(obj._p_changed, None)
         self.assertEqual(obj._p_state, GHOST)
 
+        jar.close()
+
     def test_invalidate_activate_invalidate(self):
         from persistent import GHOST
         obj = self._makeOne()
@@ -180,6 +196,8 @@
         self.assertEqual(obj._p_changed, None)
         self.assertEqual(obj._p_state, GHOST)
 
+        jar.close()
+
     def test_initial_serial(self):
         NOSERIAL = "\000" * 8
         obj = self._makeOne()
@@ -270,6 +288,8 @@
         self.assertEqual(obj.curly, 2)
         self.assertEqual(obj.moe, 3)
 
+        jar.close()
+
     def test___getattribute__(self):
         from persistent import CHANGED
         from persistent import Persistent
@@ -307,9 +327,10 @@
         self.assertEqual(obj.curly, 2)
         self.assertEqual(obj.moe, 3)
 
+        jar.close()
+
     # TODO:  Need to decide how __setattr__ and __delattr__ should work,
     # then write tests.
 
-
 def test_suite():
     return unittest.makeSuite(PersistenceTest)



More information about the Zodb-checkins mailing list