Skip to content

test(argparse): use expect_error - #4118

Merged
peter-jerry-ye merged 1 commit into
mainfrom
codex/argparse-expect-error
Aug 20, 2026
Merged

test(argparse): use expect_error#4118
peter-jerry-ye merged 1 commit into
mainfrom
codex/argparse-expect-error

Conversation

@peter-jerry-ye

Copy link
Copy Markdown
Collaborator

Why

Argparse expected-failure tests used repetitive try/catch scaffolding even though the shared test helper provides @test.expect_error for this purpose.

What changed

Expected-error assertions across the argparse black-box suites now use @test.expect_error while retaining their exact error snapshots. The package adds the test-only helper import required by that API.

Why this is correct

Each converted test still asserts that the same operation raises and preserves the same expected error output. Expected-success paths are unchanged.

Scope

This is test-only cleanup; argparse behavior and public APIs are unchanged.

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 6234

Coverage remained the same at 90.734%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 17969
Covered Lines: 16304
Line Coverage: 90.73%
Coverage Strength: 331814.11 hits per line

💛 - Coveralls

@peter-jerry-ye
peter-jerry-ye enabled auto-merge (rebase) August 20, 2026 08:35
@peter-jerry-ye
peter-jerry-ye merged commit 318a6ee into main Aug 20, 2026
16 checks passed
@peter-jerry-ye
peter-jerry-ye deleted the codex/argparse-expect-error branch August 20, 2026 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants