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