[Zope3-checkins] CVS: Zope3/src/ZODB/tests - test_cache.py:1.4

Jeremy Hylton jeremy at zope.com
Thu Mar 11 22:37:57 EST 2004


Update of /cvs-repository/Zope3/src/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv3696

Modified Files:
	test_cache.py 
Log Message:
Add another init() method so cache tests can be run in a loop.


=== Zope3/src/ZODB/tests/test_cache.py 1.3 => 1.4 ===
--- Zope3/src/ZODB/tests/test_cache.py:1.3	Tue Mar  2 13:29:58 2004
+++ Zope3/src/ZODB/tests/test_cache.py	Thu Mar 11 22:37:56 2004
@@ -26,6 +26,11 @@
     def _p_deactivate(self):
         self.__class__.deactivations += 1
 
+    def init(cls):
+        cls.deactivations = 0
+
+    init = classmethod(init)
+
 class RegularObject(Persistent):
 
     deactivations = 0
@@ -120,6 +125,7 @@
         also return when it's looked at each item, regardless of whether
         it became a ghost.
 
+        >>> RecalcitrantObject.init()
         >>> db = databaseFromString("<zodb>\n"
         ...                         "cache-size 4\n"
         ...                         "<mappingstorage/>\n"
@@ -138,7 +144,7 @@
         The Connection calls cacheGC() after it commits a transaction.
         Since the cache will now have more objects that it's target size,
         it will call _p_deactivate() on each RecalcitrantObject.
-        
+
         >>> RecalcitrantObject.deactivations
         5
         >>> [o._p_state for o in L]




More information about the Zope3-Checkins mailing list