Commit e87e1162 authored by Jeremy Hylton's avatar Jeremy Hylton

Simplify ResetCache() test.

parent 48402c4b
...@@ -143,15 +143,12 @@ class ZODBTests(unittest.TestCase): ...@@ -143,15 +143,12 @@ class ZODBTests(unittest.TestCase):
# ought to be linked to it rather than the old cache. # ought to be linked to it rather than the old cache.
self.populate() self.populate()
conn = self._db.open() conn = self._db.open()
try: conn.root()
conn.root() self.assert_(len(conn._cache) > 0) # Precondition
self.assert_(len(conn._cache) > 0) # Precondition conn._resetCache()
conn._resetCache() self.assertEqual(len(conn._cache), 0)
self.assertEqual(len(conn._cache), 0) self.assert_(conn._incrgc == conn._cache.incrgc)
self.assert_(conn._incrgc == conn._cache.incrgc) self.assert_(conn.cacheGC == conn._cache.incrgc)
self.assert_(conn.cacheGC == conn._cache.incrgc)
finally:
conn.close()
def checkLocalTransactions(self): def checkLocalTransactions(self):
# Test of transactions that apply to only the connection, # Test of transactions that apply to only the connection,
......
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