Skip to content

Commit cd62a63

Browse files
committed
Allow empty dictionaries from info and case_info
1 parent 7e32b80 commit cd62a63

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

docs/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Modify the script driver so that `info` and `case_info` may return empty dictionaries.
13+
14+
1015
## [1.2.7] - 2024-06-24 {: #v1.2.7 }
1116

1217
### Fixed

stepup/core/script.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ def get_info(self) -> dict:
211211
if not self._has_single:
212212
raise NotImplementedError("get_info only works for scripts with an info function")
213213
info = self._object.info()
214-
if not isinstance(info, dict) or len(info) == 0:
215-
raise TypeError("info must return a non-empty dictionary.")
214+
if not isinstance(info, dict):
215+
raise TypeError("info must return a dictionary.")
216216
return info
217217

218218
def get_plan(self) -> tuple[list[str], list[str], list[str]]:
@@ -261,8 +261,8 @@ def get_case_info(self, *args, **kwargs) -> dict:
261261
if not self._has_cases:
262262
raise NotImplementedError("get_case_info only works for scripts with multiple cases")
263263
info = self._object.case_info(*args, **kwargs)
264-
if not isinstance(info, dict) or len(info) == 0:
265-
raise TypeError("case_info must return a non-empty dictionary.")
264+
if not isinstance(info, dict):
265+
raise TypeError("case_info must return a dictionary.")
266266
return info
267267

268268
def get_case_plan(self, *args, **kwargs) -> tuple[list[str], list[str], list[str]]:

0 commit comments

Comments
 (0)