diff --git a/src/west/app/main.py b/src/west/app/main.py index 50bcee4..25c6a39 100755 --- a/src/west/app/main.py +++ b/src/west/app/main.py @@ -920,7 +920,7 @@ class Alias(WestCommand): return parser def do_run(self, args, ignored): - assert False + raise AssertionError("Alias command can't run directly") class WestHelpAction(argparse.Action): diff --git a/src/west/configuration.py b/src/west/configuration.py index 6c61520..d5b18f3 100644 --- a/src/west/configuration.py +++ b/src/west/configuration.py @@ -294,7 +294,7 @@ class Configuration: self._system.set(option, value) else: # Shouldn't happen. - assert False, configfile + raise AssertionError(configfile) @staticmethod def _create(path: Path) -> _InternalCF: diff --git a/src/west/manifest.py b/src/west/manifest.py index 4acfde2..0481066 100644 --- a/src/west/manifest.py +++ b/src/west/manifest.py @@ -464,11 +464,12 @@ def _update_disabled_groups(disabled_groups: set[str], else: # We should never get here. This private helper is only # meant to be invoked on valid data. - assert False, \ - (f"Unexpected group filter item {item}. " - "This is a west bug. Please report it to the developers " - "along with as much information as you can, such as the " - "stack trace that preceded this message.") + raise AssertionError( + f"Unexpected group filter item {item}. " + "This is a west bug. Please report it to the developers " + "along with as much information as you can, such as the " + "stack trace that preceded this message." + ) def _is_submodule_dict_ok(subm: Any) -> bool: # Check whether subm is a dict that contains the expected diff --git a/tests/test_project.py b/tests/test_project.py index 491347e..bada3b2 100644 --- a/tests/test_project.py +++ b/tests/test_project.py @@ -546,7 +546,7 @@ def test_update_tag_to_tag(west_init_tmpdir): p.revision = 'v2.0' break else: - assert False, 'no tagged_repo' + raise AssertionError('no tagged_repo') with open(west_init_tmpdir / 'zephyr' / 'west.yml', 'w') as f: f.write(manifest.as_yaml()) # NOT as_frozen_yaml().