diff --git a/httpfpt/schemas/case_data.py b/httpfpt/schemas/case_data.py index 8ca6424..8eaad33 100644 --- a/httpfpt/schemas/case_data.py +++ b/httpfpt/schemas/case_data.py @@ -147,7 +147,7 @@ class StepsTearDownData(BaseModel): class Steps(BaseModel): name: str case_id: str - description: str + description: str | None = None is_run: bool | dict | None = None mark: list[str] | None = None retry: int | None = None diff --git a/httpfpt/utils/request/request_data_parse.py b/httpfpt/utils/request/request_data_parse.py index 3f93324..d3aaf1b 100644 --- a/httpfpt/utils/request/request_data_parse.py +++ b/httpfpt/utils/request/request_data_parse.py @@ -274,7 +274,7 @@ def case_id(self) -> str: def description(self) -> str | None: try: description = self.request_data['test_steps']['description'] - if not isinstance(description, str): + if description and not isinstance(description, str): raise RequestDataParseError(_error_msg('参数 test_steps:description 不是有效的 str 类型')) except _RequestDataParamGetError: description = None