]> arthur.barton.de Git - bup.git/blobdiff - wvtest.py
web: fix broken GETs and test
[bup.git] / wvtest.py
index 27749e348834ee354e58c59189e4a23cee93937b..fdb4822dc3d1b90d69fe7f2060d1d46d610fa5c5 100755 (executable)
--- a/wvtest.py
+++ b/wvtest.py
@@ -1,4 +1,9 @@
-#!/usr/bin/env python
+#!/bin/sh
+"""": # -*-python-*-
+bup_python="$(dirname "$0")/cmd/bup-python"
+exec "$bup_python" "$0" ${1+"$@"}
+"""
+# end of bup preamble
 #
 # WvTest:
 #   Copyright (C)2007-2012 Versabanq Innovations Inc. and contributors.
@@ -117,7 +122,7 @@ if __name__ != '__main__':   # we're imported as a module
         '''
         try:
             func(*args, **kwargs)
-        except etype, e:
+        except etype as e:
             return _check(True, 'EXCEPT(%s)' % _code())
         except:
             _check(False, 'EXCEPT(%s)' % _code())
@@ -125,6 +130,8 @@ if __name__ != '__main__':   # we're imported as a module
         else:
             return _check(False, 'EXCEPT(%s)' % _code())
 
+    def wvfailure_count():
+        return _fails
 
     def _check_unfinished():
         if _registered:
@@ -179,7 +186,7 @@ def _runtest(fname, f):
     sys.stdout.flush()
     try:
         _run_in_chdir(os.path.split(mod.__file__)[0], f)
-    except Exception, e:
+    except Exception as e:
         print
         print traceback.format_exc()
         tb = sys.exc_info()[2]
@@ -219,4 +226,5 @@ if __name__ == '__main__':
     import wvtest as _wvtestmod
     sys.modules['wvtest'] = _wvtestmod
     sys.modules['wvtest.wvtest'] = _wvtestmod
+    wvtest = _wvtestmod
     wvtest_main(sys.argv[1:])