fix: prevent Rich from wrapping non-callable-main error across lines#35
Merged
Merged
Conversation
Rich's console.print() was word-wrapping a long error message at the
default terminal width, splitting the phrase "not callable" across two
lines ("not\ncallable"). This caused the test assertion
`"not callable" in result.output` to fail.
Adding soft_wrap=True to the affected print call disables Rich's
word-wrapping for that line, keeping the key phrase on a single line
regardless of the path length.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013EMfjMjNvvj1p3HYjbJXQe
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.
Summary
test_train_script_reports_non_callable_mainwas failing because Rich'sconsole.print()word-wrapped a long error message at the default terminal width, splitting"not callable"across two lines as"not\ncallable"."Error: Script attribute 'main' in <path> is not callable."contains a long file path. When the path pushes the line over Rich's wrap column, it splits at a word boundary — landing the break between"not"and"callable", so the assertion"not callable" in result.outputfails.soft_wrap=Trueto the singleconsole.print()call that emits this message (macfleet/cli/main.py:864).soft_wrap=Truedisables Rich's word-wrapping for that line, keeping the phrase intact regardless of path length.Test plan
pytest tests/test_cli/test_train_script.py::test_train_script_reports_non_callable_main— now passespytest tests/ -q— 681 passed, 12 skipped, 0 failedruff check macfleet/ tests/— all checks passed🤖 Generated with Claude Code
https://claude.ai/code/session_013EMfjMjNvvj1p3HYjbJXQe
Generated by Claude Code