[Zodb-checkins] CVS: ZODB3/ZODB/tests - testFileStorage.py:1.19.8.2.2.1

Tim Peters tim.one@comcast.net
Tue, 17 Dec 2002 12:17:25 -0500


Update of /cvs-repository/ZODB3/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv20747/ZODB/tests

Modified Files:
      Tag: ZODB3-fast-restart-branch
	testFileStorage.py 
Log Message:
Closing one more iterator, sufficient to let checkRestoreAcrossPack()
pass on Win2K.


=== ZODB3/ZODB/tests/testFileStorage.py 1.19.8.2 => 1.19.8.2.2.1 ===
--- ZODB3/ZODB/tests/testFileStorage.py:1.19.8.2	Fri Dec  6 17:59:30 2002
+++ ZODB3/ZODB/tests/testFileStorage.py	Tue Dec 17 12:17:25 2002
@@ -118,6 +118,7 @@
             iter = s.iterator()
             for trans in iter:
                 pass # iterate until we get the last one
+            iter.close()
             data = trans[0]
             self.assertRaises(IndexError, lambda i:trans[i], 1)
             self.assertEqual(data.oid, oid)
@@ -196,14 +197,16 @@
 
         # copy the final transaction manually.  even though there
         # was a pack, the restore() ought to succeed.
-        final = list(self._storage.iterator())[-1]
+        siter = self._storage.iterator()
+        final = list(siter)[-1]
         self._dst.tpc_begin(final, final.tid, final.status)
         for r in final:
             self._dst.restore(r.oid, r.serial, r.data, r.version, r.data_txn,
                          final)
+        siter.close()
         self._dst.tpc_vote(final)
         self._dst.tpc_finish(final)
-        
+
 
 def test_suite():
     suite = unittest.makeSuite(FileStorageTests, 'check')