Commit 5ec19b76 authored by Jeremy Hylton's avatar Jeremy Hylton

Add another init() method so cache tests can be run in a loop.

parent 723de304
...@@ -26,6 +26,11 @@ class RecalcitrantObject(Persistent): ...@@ -26,6 +26,11 @@ class RecalcitrantObject(Persistent):
def _p_deactivate(self): def _p_deactivate(self):
self.__class__.deactivations += 1 self.__class__.deactivations += 1
def init(cls):
cls.deactivations = 0
init = classmethod(init)
class RegularObject(Persistent): class RegularObject(Persistent):
deactivations = 0 deactivations = 0
...@@ -120,6 +125,7 @@ class CacheTests: ...@@ -120,6 +125,7 @@ class CacheTests:
also return when it's looked at each item, regardless of whether also return when it's looked at each item, regardless of whether
it became a ghost. it became a ghost.
>>> RecalcitrantObject.init()
>>> db = databaseFromString("<zodb>\n" >>> db = databaseFromString("<zodb>\n"
... "cache-size 4\n" ... "cache-size 4\n"
... "<mappingstorage/>\n" ... "<mappingstorage/>\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment