make logging string unicode

This commit is contained in:
debugtalk
2017-11-02 20:40:56 +08:00
parent 0018f5257e
commit 895478719d
5 changed files with 22 additions and 21 deletions

View File

@@ -131,11 +131,12 @@ class Runner(object):
try:
resp_obj.validate(validators, self.context.get_testcase_variables_mapping())
except (exception.ParamsError, exception.ResponseError, exception.ValidationError):
logging.error("Exception occured.")
logging.error("HTTP request url: \n{}".format(url))
logging.error("HTTP request kwargs: \n{}".format(parsed_request))
logging.error("HTTP response status_code: \n{}".format(resp.status_code))
logging.error("HTTP response content: \n{}".format(resp.text))
err_msg = u"Exception occured.\n"
err_msg += u"HTTP request url: {}\n".format(url)
err_msg += u"HTTP request kwargs: \n{}".format(parsed_request)
err_msg += u"HTTP response status_code: {}\n".format(resp.status_code)
err_msg += u"HTTP response content: \n{}".format(resp.text)
logging.error(err_msg)
raise
setup_teardown(teardown_actions)