Skip to content

Commit

Permalink
remove assert statement
Browse files Browse the repository at this point in the history
  • Loading branch information
ocefpaf committed May 23, 2024
1 parent 46bc074 commit b354075
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion compliance_checker/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ def __init__(
if value is None:
self.value = None
elif isinstance(value, tuple):
assert len(value) == 2, "Result value must be 2-tuple or boolean!"
if len(value) != 2:
raise ValueError(
f"Result value must be 2-tuple or boolean! Got {value}",
)
self.value = value
else:
self.value = bool(value)
Expand Down
3 changes: 2 additions & 1 deletion compliance_checker/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ def _get_valid_checkers(self, ds, checker_names):
the user selected names.
"""

assert len(self.checkers) > 0, "No checkers could be found."
if len(self.checkers) <= 0:
raise ValueError("No checkers could be found.")

if len(checker_names) == 0:
checker_names = list(self.checkers.keys())
Expand Down

0 comments on commit b354075

Please sign in to comment.