[Zodb-checkins] SVN: ZODB/branches/tim-deprecate-subtxn/src/ZODB/tests/testZODB.py checkFailingCommitSticks(): Some code simplification.

Tim Peters tim.one at comcast.net
Wed Jul 13 21:37:23 EDT 2005


Log message for revision 33311:
  checkFailingCommitSticks():  Some code simplification.
  

Changed:
  U   ZODB/branches/tim-deprecate-subtxn/src/ZODB/tests/testZODB.py

-=-
Modified: ZODB/branches/tim-deprecate-subtxn/src/ZODB/tests/testZODB.py
===================================================================
--- ZODB/branches/tim-deprecate-subtxn/src/ZODB/tests/testZODB.py	2005-07-14 01:36:00 UTC (rev 33310)
+++ ZODB/branches/tim-deprecate-subtxn/src/ZODB/tests/testZODB.py	2005-07-14 01:37:23 UTC (rev 33311)
@@ -649,9 +649,9 @@
 
         self.assertRaises(PoisonedError, transaction.get().commit)
         # Trying to commit again fails too.
-        self.assertRaises(TransactionFailedError, transaction.get().commit)
-        self.assertRaises(TransactionFailedError, transaction.get().commit)
-        self.assertRaises(TransactionFailedError, transaction.get().commit)
+        self.assertRaises(TransactionFailedError, transaction.commit)
+        self.assertRaises(TransactionFailedError, transaction.commit)
+        self.assertRaises(TransactionFailedError, transaction.commit)
 
         # The change to rt['a'] is lost.
         self.assertRaises(KeyError, rt.__getitem__, 'a')
@@ -661,16 +661,16 @@
         self.assertRaises(TransactionFailedError, rt.__setitem__, 'b', 2)
 
         # Clean up via abort(), and try again.
-        transaction.get().abort()
+        transaction.abort()
         rt['a'] = 1
-        transaction.get().commit()
+        transaction.commit()
         self.assertEqual(rt['a'], 1)
 
         # Cleaning up via begin() should also work.
         rt['a'] = 2
         transaction.get().register(poisoned)
-        self.assertRaises(PoisonedError, transaction.get().commit)
-        self.assertRaises(TransactionFailedError, transaction.get().commit)
+        self.assertRaises(PoisonedError, transaction.commit)
+        self.assertRaises(TransactionFailedError, transaction.commit)
         # The change to rt['a'] is lost.
         self.assertEqual(rt['a'], 1)
         # Trying to modify an object also fails.
@@ -678,7 +678,7 @@
         # Clean up via begin(), and try again.
         transaction.begin()
         rt['a'] = 2
-        transaction.get().commit()
+        transaction.commit()
         self.assertEqual(rt['a'], 2)
 
         cn.close()



More information about the Zodb-checkins mailing list