[Zope3-checkins] CVS: Zope3/src/ZODB/tests - testTransaction.py:1.19.2.8

Jeremy Hylton jeremy at zope.com
Wed Mar 31 14:14:25 EST 2004


Update of /cvs-repository/Zope3/src/ZODB/tests
In directory cvs.zope.org:/tmp/cvs-serv13028

Modified Files:
      Tag: jeremy-txn-branch
	testTransaction.py 
Log Message:
Make sure this test doesn't permanently change the global TM.

Also clean up imports and module-level docstring.


=== Zope3/src/ZODB/tests/testTransaction.py 1.19.2.7 => 1.19.2.8 ===
--- Zope3/src/ZODB/tests/testTransaction.py:1.19.2.7	Tue Mar 30 15:19:01 2004
+++ Zope3/src/ZODB/tests/testTransaction.py	Wed Mar 31 14:14:24 2004
@@ -11,13 +11,7 @@
 # FOR A PARTICULAR PURPOSE
 #
 ##############################################################################
-
-"""
-Revision information:
-$Id$
-"""
-
-"""
+"""Test tranasction behavior for variety of cases.
 
 I wrote these unittests to investigate some odd transaction
 behavior when doing unittests of integrating non sub transaction
@@ -42,18 +36,16 @@
     add in tests for objects which are modified multiple times,
     for example an object that gets modified in multiple sub txns.
 
+$Id$
 """
 
-from types import TupleType
 import unittest
-
-from ZODB import Transaction
 import transaction
 
 class TransactionTests(unittest.TestCase):
 
     def setUp(self):
-
+        self.orig_tm = transaction.manager
         transaction.manager = transaction.TransactionManager()
         Transaction.hosed = 0
         self.sub1 = DataObject()
@@ -62,7 +54,7 @@
         self.nosub1 = DataObject(nost=1)
 
     def tearDown(self):
-        pass
+        transaction.manager = self.orig_tm
 
     # basic tests with two sub trans jars
     # really we only need one, so tests for
@@ -534,7 +526,7 @@
 class BasicJar:
 
     def __init__(self, errors=(), tracing=0):
-        if not isinstance(errors, TupleType):
+        if not isinstance(errors, tuple):
             errors = errors,
         self.errors = errors
         self.tracing = tracing




More information about the Zope3-Checkins mailing list