[Zodb-checkins] CVS: ZODB3/ZEO/tests - testTransactionBuffer.py:1.6

Jeremy Hylton jeremy at zope.com
Fri Dec 26 16:05:45 EST 2003


Update of /cvs-repository/ZODB3/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv22092/ZEO/tests

Modified Files:
	testTransactionBuffer.py 
Log Message:
Change TransactionBuffer to use a real iterator.

This eliminates a bunch of checks that weren't exercised by the test
suite.  Not sure if they were superstition or not, but I'm willing to
risk it.


=== ZODB3/ZEO/tests/testTransactionBuffer.py 1.5 => 1.6 ===
--- ZODB3/ZEO/tests/testTransactionBuffer.py:1.5	Thu Aug 29 12:32:51 2002
+++ ZODB3/ZEO/tests/testTransactionBuffer.py	Fri Dec 26 16:05:44 2003
@@ -35,13 +35,9 @@
         tbuf = TransactionBuffer()
         tbuf.store(*new_store_data())
         tbuf.invalidate(*new_invalidate_data())
-        tbuf.begin_iterate()
-        while 1:
-            o = tbuf.next()
-            if o is None:
-                break
-        tbuf.clear()
-
+        for o in tbuf:
+            pass
+            
     def doUpdates(self, tbuf):
         data = []
         for i in range(10):
@@ -52,9 +48,7 @@
             tbuf.invalidate(*d)
             data.append(d)
 
-        tbuf.begin_iterate()
-        for i in range(len(data)):
-            x = tbuf.next()
+        for i, x in enumerate(tbuf):
             if x[2] is None:
                 # the tbuf add a dummy None to invalidates
                 x = x[:2]




More information about the Zodb-checkins mailing list