def report(service, testcase):
def decorate(function):
def get_result(code, message=None):
result = Result()
result.exit_code = code
result.stderr = message
result.command = None
return result
def new_f(*args, **kwargs):
try:
function_result = function(*args, **kwargs)
except AssertionError:
error_type, error_message, error_traceback = sys.exc_info()
raise
return function_result
new_f.func_name = function.func_name
return new_f
return decorate
评论列表
文章目录