devtools/testlib.py
changeset 5408 120db445c179
parent 5385 b6e250dd7a7d
parent 5401 547911327475
child 5423 e15abfdcce38
--- a/devtools/testlib.py	Fri Apr 23 17:56:01 2010 +0200
+++ b/devtools/testlib.py	Mon Apr 26 16:31:46 2010 +0200
@@ -17,11 +17,6 @@
 from contextlib import contextmanager
 from warnings import warn
 
-try:
-    import json
-except ImportError:
-    import simplejson as json
-
 import yams.schema
 
 from logilab.common.testlib import TestCase, InnerTest
@@ -39,7 +34,7 @@
 from cubicweb.server.session import security_enabled
 from cubicweb.devtools import SYSTEM_ENTITIES, SYSTEM_RELATIONS, VIEW_VALIDATORS
 from cubicweb.devtools import fake, htmlparser
-
+from cubicweb.utils import json
 
 # low-level utilities ##########################################################
 
@@ -263,10 +258,10 @@
             self.__class__._repo_init_failed = ex
             raise
         resume_tracing()
+        self._cnxs = []
         self.setup_database()
         self.commit()
         MAILBOX[:] = [] # reset mailbox
-        self._cnxs = []
 
     def tearDown(self):
         for cnx in self._cnxs: