devtools/testlib.py
branchstable
changeset 7815 2a164a9cf81c
parent 7782 40a49f4350a5
child 7845 2172978be237
child 7879 9aae456abab5
--- a/devtools/testlib.py	Tue Sep 20 15:14:04 2011 +0200
+++ b/devtools/testlib.py	Wed Sep 21 17:38:00 2011 +0200
@@ -233,7 +233,7 @@
         # web resources
         try:
             config.global_set_option('embed-allowed', re.compile('.*'))
-        except: # not in server only configuration
+        except Exception: # not in server only configuration
             pass
 
     #XXX this doesn't need to a be classmethod anymore
@@ -812,15 +812,13 @@
         """
         try:
             output = viewfunc(**kwargs)
-        except (SystemExit, KeyboardInterrupt):
-            raise
-        except:
+        except Exception:
             # hijack exception: generative tests stop when the exception
             # is not an AssertionError
             klass, exc, tcbk = sys.exc_info()
             try:
                 msg = '[%s in %s] %s' % (klass, view.__regid__, exc)
-            except:
+            except Exception:
                 msg = '[%s in %s] undisplayable exception' % (klass, view.__regid__)
             raise AssertionError, msg, tcbk
         return self._check_html(output, view, template)
@@ -862,9 +860,7 @@
     def assertWellFormed(self, validator, content, context=None):
         try:
             return validator.parse_string(content)
-        except (SystemExit, KeyboardInterrupt):
-            raise
-        except:
+        except Exception:
             # hijack exception: generative tests stop when the exception
             # is not an AssertionError
             klass, exc, tcbk = sys.exc_info()
@@ -876,7 +872,7 @@
 
             try:
                 str_exc = str(exc)
-            except:
+            except Exception:
                 str_exc = 'undisplayable exception'
             msg += str_exc
             if content is not None:
@@ -1179,7 +1175,7 @@
         reg._selected = {}
         try:
             orig_select_best = reg.__class__.__orig_select_best
-        except:
+        except Exception:
             orig_select_best = reg.__class__._select_best
         def instr_select_best(self, *args, **kwargs):
             selected = orig_select_best(self, *args, **kwargs)