def exercise_user_plus_sys_time(): s = StringIO() utils.user_plus_sys_time().show_elapsed(out=s, prefix="e: ") s = s.getvalue() assert s.startswith("e: ") assert s.endswith(" s") utils.user_plus_sys_time().show_delta(out=s, prefix="d: ") s = s.getvalue() assert s.startswith("d: ") assert s.endswith(" s")
def error_msg(debugger_args): """Error has been caught and we were given chance to report it""" debug_no, params = parse_args(debugger_args) if debug_no == '3': exc_info = sys.exc_info() if exc_info[0]: exception_data = StringIO() traceback.print_exception(exc_info[0], exc_info[1], exc_info[2], None, exception_data) exception_data = exception_data.getvalue() if exception_data.endswith('\n'): exception_data = exception_data[:-1] #pydev is truncating data (no help printing in loop) sys.stderr.write('\n\n...') sys.stderr.write(exception_data[-600:]) sys.stderr.write('\n\n')