[Zope3-checkins] SVN: Zope3/trunk/src/zope/rdb/tests/test_ Add missing cleanup to zope.rdb unit tests.

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


Log message for revision 72141:
  Add missing cleanup to zope.rdb unit tests.
  
  

Changed:
  U   Zope3/trunk/src/zope/rdb/tests/test_gadflyadapter.py
  U   Zope3/trunk/src/zope/rdb/tests/test_gadflyphantom.py
  U   Zope3/trunk/src/zope/rdb/tests/test_zopecursor.py

-=-
Modified: Zope3/trunk/src/zope/rdb/tests/test_gadflyadapter.py
===================================================================
--- Zope3/trunk/src/zope/rdb/tests/test_gadflyadapter.py	2007-01-20 13:25:48 UTC (rev 72140)
+++ Zope3/trunk/src/zope/rdb/tests/test_gadflyadapter.py	2007-01-20 13:32:07 UTC (rev 72141)
@@ -19,6 +19,7 @@
 import tempfile
 from unittest import TestCase, TestSuite, main, makeSuite
 
+import transaction
 from zope.interface.verify import verifyObject
 
 from zope.rdb import DatabaseAdapterError
@@ -175,6 +176,9 @@
         self.connection = self.adapter()
         self.cursor = self.connection.cursor()
 
+    def tearDown(self):
+        transaction.abort()
+
     def testBadExecutemanyOperations(self):
         raises = self.assertRaises
         for operation in [

Modified: Zope3/trunk/src/zope/rdb/tests/test_gadflyphantom.py
===================================================================
--- Zope3/trunk/src/zope/rdb/tests/test_gadflyphantom.py	2007-01-20 13:25:48 UTC (rev 72140)
+++ Zope3/trunk/src/zope/rdb/tests/test_gadflyphantom.py	2007-01-20 13:32:07 UTC (rev 72141)
@@ -13,13 +13,14 @@
 ##############################################################################
 """Gadfly Database adapter phatom tests
 
-$Id: $
+$Id$
 """
 __docformat__ = 'restructuredtext'
 import os, shutil
 import tempfile, threading
 from unittest import TestCase, TestSuite, main, makeSuite
 
+import transaction
 from zope.rdb.gadflyda import GadflyAdapter, setGadflyRoot
 
 class GadflyTestBase(TestCase):
@@ -66,6 +67,10 @@
         cur.execute("create table t1 (name varchar)")
         conn.commit()
 
+    def tearDown(self):
+        GadflyTestBase.tearDown(self)
+        transaction.abort()
+
     def test_Phantom(self):
 
         adapter = self.adapter

Modified: Zope3/trunk/src/zope/rdb/tests/test_zopecursor.py
===================================================================
--- Zope3/trunk/src/zope/rdb/tests/test_zopecursor.py	2007-01-20 13:25:48 UTC (rev 72140)
+++ Zope3/trunk/src/zope/rdb/tests/test_zopecursor.py	2007-01-20 13:32:07 UTC (rev 72141)
@@ -16,6 +16,8 @@
 $Id$
 """
 from unittest import TestCase, main, makeSuite
+
+import transaction
 from zope.rdb import ZopeConnection
 from zope.rdb import ZopeCursor
 from zope.rdb.tests.stubs import *
@@ -106,6 +108,9 @@
         zc = ZopeConnection(MyConnectionStub(), self.typeInfo)
         self.cursor = ZopeCursor(zc.conn.cursor(), zc)
 
+    def tearDown(self):
+        transaction.abort()
+
     def test_cursor_fetchone(self):
         results = self.cursor.fetchone()
         expected = converted[0]



More information about the Zope3-Checkins mailing list