[Neo-report] r1933 vincent - in /trunk/neo/tests/zodb: __init__.py testZODB.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Mar 10 16:51:57 CET 2010


Author: vincent
Date: Wed Mar 10 16:51:54 2010
New Revision: 1933

Log:
Only testZODB requires a _db property.

Creating this property on other tests "pollutes" the database, as it
creates the root object.

Modified:
    trunk/neo/tests/zodb/__init__.py
    trunk/neo/tests/zodb/testZODB.py

Modified: trunk/neo/tests/zodb/__init__.py
==============================================================================
--- trunk/neo/tests/zodb/__init__.py [iso-8859-1] (original)
+++ trunk/neo/tests/zodb/__init__.py [iso-8859-1] Wed Mar 10 16:51:54 2010
@@ -16,7 +16,6 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 import unittest
-import ZODB
 
 from neo.tests.functional import NEOCluster, NEOFunctionalTest
 
@@ -31,10 +30,8 @@
         self.neo.setupDB()
         self.neo.start()
         self._storage = self.neo.getZODBStorage()
-        self._db = ZODB.DB(self._storage)
 
     def tearDown(self):
-        self._db.close()
         self._storage.cleanup()
         self.neo.stop()
 

Modified: trunk/neo/tests/zodb/testZODB.py
==============================================================================
--- trunk/neo/tests/zodb/testZODB.py [iso-8859-1] (original)
+++ trunk/neo/tests/zodb/testZODB.py [iso-8859-1] Wed Mar 10 16:51:54 2010
@@ -17,11 +17,19 @@
 
 import unittest
 from ZODB.tests import testZODB
+import ZODB
 
 from neo.tests.zodb import ZODBTestCase
 
 class NEOZODBTests(ZODBTestCase, testZODB.ZODBTests):
-    pass
+
+    def setUp(self):
+        super(NEOZODBTests, self).setUp()
+        self._db = ZODB.DB(self._storage)
+
+    def tearDown(self):
+        self._db.close()
+        super(NEOZODBTests, self).tearDown()
 
 if __name__ == "__main__":
     suite = unittest.makeSuite(NEOZODBTests, 'check')





More information about the Neo-report mailing list