[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/session/tests.py Add missing cleanup to zope.app.session unit tests.

Marius Gedminas marius at pov.lt
Sat Jan 20 08:53:50 EST 2007


Log message for revision 72142:
  Add missing cleanup to zope.app.session unit tests.
  
  

Changed:
  U   Zope3/trunk/src/zope/app/session/tests.py

-=-
Modified: Zope3/trunk/src/zope/app/session/tests.py
===================================================================
--- Zope3/trunk/src/zope/app/session/tests.py	2007-01-20 13:32:07 UTC (rev 72141)
+++ Zope3/trunk/src/zope/app/session/tests.py	2007-01-20 13:53:49 UTC (rev 72142)
@@ -20,6 +20,7 @@
 from zope.testing import doctest
 from zope.app import zapi
 from zope.app.testing import ztapi, placelesssetup
+import transaction
 
 from zope.app.session.interfaces import IClientId, IClientIdManager, ISession
 from zope.app.session.interfaces import ISessionDataContainer
@@ -89,11 +90,17 @@
 
     ''' % (open(os.path.join(os.path.dirname(__file__), 'api.txt')).read(),)
 
+
+def tearDownTransaction(test):
+    transaction.abort()
+
+
 def test_suite():
     suite = unittest.TestSuite()
     suite.addTest(unittest.makeSuite(TestBootstrap))
     suite.addTest(doctest.DocTestSuite())
-    suite.addTest(doctest.DocTestSuite('zope.app.session.session'))
+    suite.addTest(doctest.DocTestSuite('zope.app.session.session',
+                                       tearDown=tearDownTransaction))
     suite.addTest(doctest.DocTestSuite('zope.app.session.http'))
     return suite
 



More information about the Zope3-Checkins mailing list