-#!/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.
_result(msg, tb, 'FAILED')
return cond
-
+ _code_rx = re.compile(r'^\w+\((.*)\)(\s*#.*)?$')
def _code():
(filename, line, func, text) = traceback.extract_stack()[-3]
- text = re.sub(r'^\w+\((.*)\)(\s*#.*)?$', r'\1', text);
- return text
+ return _code_rx.sub(r'\1', text)
+
def WVMSG(message):
'''
try:
func(*args, **kwargs)
- except etype, e:
+ except etype as e:
return _check(True, 'EXCEPT(%s)' % _code())
except:
_check(False, 'EXCEPT(%s)' % _code())
else:
return _check(False, 'EXCEPT(%s)' % _code())
+ def wvfailure_count():
+ return _fails
def _check_unfinished():
if _registered:
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]
print
-def wvtest_main(extra_testfiles=[]):
+def wvtest_main(extra_testfiles=tuple()):
import wvtest as _wvtestmod
_run_registered_tests()
for modname in extra_testfiles:
import wvtest as _wvtestmod
sys.modules['wvtest'] = _wvtestmod
sys.modules['wvtest.wvtest'] = _wvtestmod
+ wvtest = _wvtestmod
wvtest_main(sys.argv[1:])