test: cover CLI paths and string-length boundary; clarify cls comment#89
Merged
Conversation
- Add tests for run_on_file (reporting, max_string_length, SyntaxError branch) and main(), which were previously untested. - Add a max_string_length boundary test (len == max is flagged). - Use a fixture to restore the class-level option these tests mutate. - Fix the misleading "# unused" comment on Flake8ASTErrorInfo.cls; it is the 4th tuple element flake8 expects. Refs #86 Assisted-by: ClaudeCode:claude-opus-4.8
Fold the pre-existing test that mutated the class-level option into the restoring fixture, so it no longer leaks state to later tests. Assisted-by: ClaudeCode:claude-opus-4.8
c0690f1 to
1815be0
Compare
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.
🤖 AI text below 🤖
Closes item 3 and the Minor note of #86.
Tests
run_on_filewas entirely untested. Added coverage for: error reporting to stdout, themax_string_lengthargument, and theSyntaxErrorbranch (assertsSystemExit(1)and theTraceback:output).main()(argv parsing -> reporting).max_string_lengthboundary test confirminglen == maxis flagged (the check is>=).max_string_lengthoption, so a fixture restores it — addressing the test-ordering fragility called out inCLAUDE.md.Minor
Flake8ASTErrorInfo.clswas annotated# unused, but it is the 4th tuple element flake8 expects. Comment corrected.Pure test/comment changes — no behavior change. 14 tests pass; lint/mypy clean.