Summary
In numbast/src/numbast/experimental/mlir/tools/tests/test_cli.py (lines 82–83), the test test_cli_yml_invalid_inputs uses the following anti-pattern:
with pytest.raises(Exception):
assert result.exit_code == 0
This passes by catching the AssertionError raised when the exit code is non-zero, which can mask actual failures (e.g., the CLI crashing with an unexpected exception rather than returning a non-zero exit code for the expected reason).
Suggested Fix
Replace the block with direct assertions:
assert result.exit_code != 0
assert result.exception is not None
References
Requested by @isVoid.
Summary
In
numbast/src/numbast/experimental/mlir/tools/tests/test_cli.py(lines 82–83), the testtest_cli_yml_invalid_inputsuses the following anti-pattern:This passes by catching the
AssertionErrorraised when the exit code is non-zero, which can mask actual failures (e.g., the CLI crashing with an unexpected exception rather than returning a non-zero exit code for the expected reason).Suggested Fix
Replace the block with direct assertions:
References
Requested by @isVoid.