Repository navigation
test(cli): tests check error code exit code or match - #2876
Merged
Merged
Conversation
dan-petty
force-pushed
the
test/2177-tests-check-error-code-or-match
branch
from
October 31, 2026 15:09
6f9956e to
8ea8765
Compare
dan-petty
marked this pull request as ready for review
October 31, 2026 15:20
dan-petty
force-pushed
the
test/2177-tests-check-error-code-or-match
branch
from
October 31, 2026 15:33
8ea8765 to
b6a7fd3
Compare
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request ensures that each test of an error path verifies the error code, exit code, or error message.
test-pytest-raises-checks-errorast-grep rule and rule test to report any barepytest.raises(...)withoutmatch=or anas ...target.test-pytest-raises-checks-errorrule in architectural invariants tests (CONST_TEST_CONSTRUCT_RULESand_VIOLATIONS).pytest.raisescalls across the test suite to assert the machine-readableerror_codeforDevOpsCLIErrorinstances, verify exit codes fortyper.Exit, and assert error messages or attributes for library exceptions.2177-tests-check-error-code-or-match.Verification
pytest.raisescalls without error verification remain acrosstests/.pytest.raises(ValidationError).test_invalid_k8s_label_names_rejected,test_http_broker_hook_refuses_a_scheme_other_than_http,test_run_json_subprocess_raises_on_malformed_json_without_default) and pass when restored.uv run pytest tests/invariants/test_architectural_invariants.py tests/commands/test_net_construct_rules.pypasses (149 tests).Closes #2177