def Go(): o = cls(t) o.setUp() try: getattr(o, t)() except Exception, e: print print traceback.format_exc() tb = sys.exc_info()[2] wvtest._result(repr(e), traceback.extract_tb(tb)[-1], 'EXCEPTION')
def _runtest(modname, fname, f): print print 'Testing "%s" in %s.py:' % (fname, modname) sys.stdout.flush() try: f() except Exception, e: print print traceback.format_exc() tb = sys.exc_info()[2] wvtest._result(e, traceback.extract_tb(tb)[1], 'EXCEPTION')
def runtest(modname, fname, f): print print 'Testing "%s" in %s.py:' % (fname, modname) try: f() except Exception, e: print print traceback.format_exc() tb = sys.exc_info()[2] wvtest._result(e, traceback.extract_tb(tb)[-1], 'EXCEPTION')
def _runtest(fname, f, innerfunc): import wvtest as _wvtestmod mod = inspect.getmodule(innerfunc) relpath = os.path.relpath(mod.__file__, os.getcwd()).replace('.pyc', '.py') print print 'Testing "%s" in %s:' % (fname, relpath) sys.stdout.flush() try: _run_in_chdir(os.path.split(mod.__file__)[0], f) except Exception, e: print print traceback.format_exc() tb = sys.exc_info()[2] _wvtestmod._result(repr(e), traceback.extract_tb(tb)[-1], 'EXCEPTION')