[Zodb-checkins] CVS: StandaloneZODB/ZODB/tests - Synchronization.py:1.4 VersionStorage.py:1.13

Jeremy Hylton jeremy@zope.com
Fri, 25 Jan 2002 17:19:48 -0500


Update of /cvs-repository/StandaloneZODB/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv31058

Modified Files:
	Synchronization.py VersionStorage.py 
Log Message:
Always abort a transaction that raised an exception.


=== StandaloneZODB/ZODB/tests/Synchronization.py 1.3 => 1.4 ===
 
     def verifyWrongTrans(self, callable, *args):
-        self._storage.tpc_begin(Transaction())
-        args = (StorageTransactionError, callable) + args
-        apply(self.assertRaises, args)
+        t = Transaction()
+        self._storage.tpc_begin(t)
+        self.assertRaises(StorageTransactionError, callable, *args)
+        self._storage.tpc_abort(t)
 
     def checkAbortVersionNotCommitting(self):
         self.verifyNotCommitting(self._storage.abortVersion,


=== StandaloneZODB/ZODB/tests/VersionStorage.py 1.12 => 1.13 ===
         t = Transaction()
         self._storage.tpc_begin(t)
-        self.assertRaises(POSException.VersionCommitError,
-                          self._storage.commitVersion,
-                          'one', 'one', t)
+        try:
+            self.assertRaises(POSException.VersionCommitError,
+                              self._storage.commitVersion,
+                              'one', 'one', t)
+        finally:
+            self._storage.tpc_abort(t)
 
     def checkModifyAfterAbortVersion(self):
         eq = self.assertEqual