mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
fix: eval validator python script before validating
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Release History
|
||||
|
||||
## 2.4.9 (2019-12-25)
|
||||
## 2.4.9 (2019-12-26)
|
||||
|
||||
**Added**
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
**Fixed**
|
||||
|
||||
- fix: display validators in report when validate raised exception
|
||||
- fix: eval validator python script before validating
|
||||
|
||||
## 2.4.8 (2019-12-25)
|
||||
|
||||
|
||||
@@ -124,7 +124,8 @@ except Exception as ex:
|
||||
for validator in validators:
|
||||
|
||||
if isinstance(validator, dict) and validator.get("type") == "python_script":
|
||||
validator_dict, ex = self.validate_script(validator["script"])
|
||||
script = self.session_context.eval_content(validator["script"])
|
||||
validator_dict, ex = self.validate_script(script)
|
||||
if ex:
|
||||
validate_pass = False
|
||||
failures.append(ex)
|
||||
|
||||
Reference in New Issue
Block a user