devtools/testlib.py
changeset 7845 2172978be237
parent 7821 3ecd114f6d75
parent 7815 2a164a9cf81c
child 7894 ad0eeb0f7a8d
--- a/devtools/testlib.py	Fri Sep 23 09:17:37 2011 +0200
+++ b/devtools/testlib.py	Fri Sep 23 14:18:13 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
@@ -787,15 +787,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)
@@ -837,9 +835,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()
@@ -851,7 +847,7 @@
 
             try:
                 str_exc = str(exc)
-            except:
+            except Exception:
                 str_exc = 'undisplayable exception'
             msg += str_exc
             if content is not None:
@@ -1154,7 +1150,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)