[test] workaround connection leak making tests fail under windows environment (though we've still probably some open connection leak to resolve...) stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 17 Jun 2010 16:24:01 +0200
branchstable
changeset 5778 1a4ac9e2ce63
parent 5777 941038164cf5
child 5781 a3e60e0fb0f3
[test] workaround connection leak making tests fail under windows environment (though we've still probably some open connection leak to resolve...)
devtools/testlib.py
--- a/devtools/testlib.py	Thu Jun 17 16:17:09 2010 +0200
+++ b/devtools/testlib.py	Thu Jun 17 16:24:01 2010 +0200
@@ -218,7 +218,10 @@
         if not 'repo' in cls.__dict__:
             cls._build_repo()
         else:
-            cls.cnx.rollback()
+            try:
+                cls.cnx.rollback()
+            except:
+                pass
             cls._refresh_repo()
 
     @classmethod
@@ -280,6 +283,7 @@
         MAILBOX[:] = [] # reset mailbox
 
     def tearDown(self):
+        self.cnx.rollback()
         for cnx in self._cnxs:
             if not cnx._closed:
                 cnx.close()