diff --git a/python/lsst/daf/butler/cli/utils.py b/python/lsst/daf/butler/cli/utils.py index 32a84f4259..e15ce6d3bd 100644 --- a/python/lsst/daf/butler/cli/utils.py +++ b/python/lsst/daf/butler/cli/utils.py @@ -843,7 +843,7 @@ def _capture_args(self, ctx: click.Context, args: list[str]) -> None: if (opt := opts[param_name]) is not None: captured_args.append(opt) else: - assert False # All parameters should be an Option or an Argument. + raise AssertionError("All parameters should be an Option or an Argument") MWCtxObj.getFrom(ctx).args = captured_args def parse_args(self, ctx: click.Context, args: Any) -> list[str]: diff --git a/python/lsst/daf/butler/core/dimensions/_coordinate.py b/python/lsst/daf/butler/core/dimensions/_coordinate.py index 8993c91d74..0bdf25fb0f 100644 --- a/python/lsst/daf/butler/core/dimensions/_coordinate.py +++ b/python/lsst/daf/butler/core/dimensions/_coordinate.py @@ -956,7 +956,7 @@ def hasRecords(self) -> bool: def _record(self, name: str) -> DimensionRecord | None: # Docstring inherited from DataCoordinate. - assert False + raise AssertionError() def __reduce__(self) -> tuple[Any, ...]: return (_BasicTupleDataCoordinate, (self._graph, self._values))