[Checkins] SVN: ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py Added an abort on tearDown to avoid leaking storages between tests.

Jim Fulton jim at zope.com
Sat Oct 25 20:36:17 EDT 2008


Log message for revision 92558:
  Added an abort on tearDown to avoid leaking storages between tests.
  

Changed:
  U   ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py

-=-
Modified: ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py	2008-10-26 00:36:14 UTC (rev 92557)
+++ ZODB/trunk/src/ZODB/tests/testConnectionSavepoint.py	2008-10-26 00:36:16 UTC (rev 92558)
@@ -17,7 +17,8 @@
 """
 import unittest
 from zope.testing import doctest
-import persistent.dict, transaction
+import persistent.dict
+import transaction
 
 def testAddingThenModifyThenAbort():
     """\
@@ -153,10 +154,13 @@
     False
 """
 
+def tearDown(test):
+    transaction.abort()
+
 def test_suite():
     return unittest.TestSuite((
-        doctest.DocFileSuite('testConnectionSavepoint.txt'),
-        doctest.DocTestSuite(),
+        doctest.DocFileSuite('testConnectionSavepoint.txt', tearDown=tearDown),
+        doctest.DocTestSuite(tearDown=tearDown),
         ))
 
 if __name__ == '__main__':



More information about the Checkins mailing list