diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 321274a9..8faab34f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,7 +31,7 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.4 + rev: v0.4.5 hooks: - id: ruff diff --git a/compliance_checker/base.py b/compliance_checker/base.py index 933d5a5a..4cf5e751 100644 --- a/compliance_checker/base.py +++ b/compliance_checker/base.py @@ -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) diff --git a/compliance_checker/suite.py b/compliance_checker/suite.py index 60008488..a548aae7 100644 --- a/compliance_checker/suite.py +++ b/compliance_checker/suite.py @@ -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())