refactor teardown_hooks set attribute: remove response attributes interlayer

This commit is contained in:
httprunner
2018-07-27 12:10:45 +08:00
parent bc56a7501b
commit 35006a313e
3 changed files with 20 additions and 11 deletions

View File

@@ -102,7 +102,10 @@ def alter_response(response):
response.status_code = 500
response.headers["Content-Type"] = "html/text"
response.json["headers"]["Host"] = "127.0.0.1:8888"
response.attributes["new_attribute"] = "new_attribute"
response.new_attribute = "new_attribute_value"
response.new_attribute_dict = {
"key": 123
}
def alter_response_error(response):
# NameError