3 import sys, imp, types, os, os.path
6 def runtest(modname, fname, f):
8 print 'Testing "%s" in %s.py:' % (fname, modname)
13 print traceback.format_exc()
14 tb = sys.exc_info()[2]
15 wvtest._result(e, traceback.extract_tb(tb)[-1],
18 for modname in sys.argv[1:]:
19 if modname.endswith('.py'):
20 modname = modname[:-3]
22 print 'Importing: %s' % modname
23 wvtest._registered = []
24 mod = __import__(modname, None, None, [])
26 for t in wvtest._registered:
27 runtest(modname, t.func_name, t)
30 print 'WvTest: %d tests, %d failures.' % (wvtest._tests, wvtest._fails)