[devtools/teslib] be more defensive on rollbacks stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Thu, 17 Jun 2010 18:50:20 +0200
branchstable
changeset 5783 c5ff8cd74758
parent 5782 8ff48d1a319f
child 5784 8b2264e485bc
[devtools/teslib] be more defensive on rollbacks
devtools/testlib.py
--- a/devtools/testlib.py	Thu Jun 17 18:36:16 2010 +0200
+++ b/devtools/testlib.py	Thu Jun 17 18:50:20 2010 +0200
@@ -220,7 +220,7 @@
         else:
             try:
                 cls.cnx.rollback()
-            except:
+            except ProgrammingError:
                 pass
             cls._refresh_repo()
 
@@ -283,7 +283,10 @@
         MAILBOX[:] = [] # reset mailbox
 
     def tearDown(self):
-        self.cnx.rollback()
+        try:
+            self.cnx.rollback()
+        except ProgrammingError:
+            pass
         for cnx in self._cnxs:
             if not cnx._closed:
                 cnx.close()