From 134f3c6fb3c9ed232058baa1a62fa82d62d4607a Mon Sep 17 00:00:00 2001 From: debugtalk Date: Fri, 3 Jul 2020 20:02:08 +0800 Subject: [PATCH] fix: raise TestCaseFormatError if teststep validate invalid --- httprunner/compat.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/httprunner/compat.py b/httprunner/compat.py index 21f7a809..dd6b526e 100644 --- a/httprunner/compat.py +++ b/httprunner/compat.py @@ -182,6 +182,10 @@ def _ensure_step_attachment(step: Dict) -> Dict: test_dict["export"] = step["export"] if "validate" in step: + if not isinstance(step["validate"], List): + raise exceptions.TestCaseFormatError( + f'Invalid teststep validate: {step["validate"]}' + ) test_dict["validate"] = _convert_validators(step["validate"]) if "validate_script" in step: