diff --git a/reframe/frontend/cli.py b/reframe/frontend/cli.py index 6f05080d4d..7514f3bf78 100644 --- a/reframe/frontend/cli.py +++ b/reframe/frontend/cli.py @@ -1240,11 +1240,12 @@ def module_unuse(*paths): try: rt.modules_system.load_module(**m, force=True) except errors.EnvironError as e: - printer.warning( - f'could not load module {m["name"]!r} correctly; ' - f'skipping...' + printer.error( + f'could not load module {m["name"]!r} correctly; rerun ' + f'with -vv for more information' ) printer.debug(str(e)) + sys.exit(1) options.flex_alloc_nodes = options.flex_alloc_nodes or 'idle' diff --git a/unittests/test_cli.py b/unittests/test_cli.py index 12ce3ad0e0..4527e655bb 100644 --- a/unittests/test_cli.py +++ b/unittests/test_cli.py @@ -721,7 +721,7 @@ def test_unuse_module_path(run_reframe, user_exec_ctx): ms.searchpath_remove(module_path) assert "could not load module 'testmod_foo' correctly" in stdout assert 'Traceback' not in stderr - assert returncode == 0 + assert returncode == 1 def test_use_module_path(run_reframe, user_exec_ctx):