Skip to content

test(cli): keep the closed-stdout test working on Python 3.14 - #94

Merged
Bytewave1 merged 1 commit into
mainfrom
fix/closed-stdout-test-py314
Oct 30, 2026
Merged

Bytewave1 merged 1 commit into
mainfrom
fix/closed-stdout-test-py314

Conversation

@Bytewave1

Copy link
Copy Markdown
Owner

The test added in #54 fakes a stdout whose fileno() always raises ValueError. On Python 3.14, argparse calls sys.stdout.fileno() while the parser is built, so main() failed before it reached the code under test and the ubuntu/macOS 3.14 jobs on main went red.

The fake now raises the ValueError only after the write has failed, which is the case the test is meant to cover. Verified on 3.13 and 3.14: 617 passed, 100% line and branch coverage, ruff clean. Removing ValueError from the except in _silence_broken_pipe makes the test fail on both versions.

Tests only, no CHANGELOG entry needed.

@Bytewave1
Bytewave1 merged commit 07bd7a3 into main Oct 30, 2026
11 checks passed
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.

1 participant