Update tests/test_output_formatter.py#15
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new test suite for the output formatting module, covering text, markdown, and JSON formats. The review feedback recommends removing redundant Python 2-style string prefixes and strengthening markdown assertions to check for specific formatting elements.
| assert u" • src/main.py" in result | ||
| assert u" • src/utils.py" in result | ||
| assert u"— AsyncReview • gemini/gemini-3-pro-preview" in result |
There was a problem hiding this comment.
The u prefix for string literals is redundant in Python 3. Since this project uses modern Python features (like PEP 604 union types in the source code), these prefixes can be removed to keep the code clean and idiomatic.
| assert u" • src/main.py" in result | |
| assert u" • src/utils.py" in result | |
| assert u"— AsyncReview • gemini/gemini-3-pro-preview" in result | |
| assert " • src/main.py" in result | |
| assert " • src/utils.py" in result | |
| assert "— AsyncReview • gemini/gemini-3-pro-preview" in result |
| assert "## Review" in result | ||
| assert "### Sources" in result | ||
| assert "src/main.py" in result | ||
| assert "---" in result | ||
| assert "AsyncReview" in result |
There was a problem hiding this comment.
These assertions are quite loose and don't verify the specific Markdown formatting (like backticks for sources or italicization for the footer). Strengthening these assertions will better protect against formatting regressions.
| assert "## Review" in result | |
| assert "### Sources" in result | |
| assert "src/main.py" in result | |
| assert "---" in result | |
| assert "AsyncReview" in result | |
| assert "## Review" in result | |
| assert "### Sources" in result | |
| assert "- `src/main.py`" in result | |
| assert "---" in result | |
| assert "*AsyncReview • gemini/gemini-3-pro-preview*" in result |
ac80f13 to
4913371
Compare
Summary
I see the current state: the file has been partially modified with 15 tests (236 lines). TestFormatText and TestFormatMarkdown got their edge-case tests, but TestFormatJson and TestFormatOutput did not. The JIT output shows exact line positions: TestFormatJson ends at line 188 with
assert data["metadata"]["files_reviewed"] == 1, followed by two blank lines (189-190), thenclass TestFormatOutput:at line 191. The file ends at line 236 with an empty line afterassert u"— AsyncReview" in resulton line 235.I need to apply the two remaining edits using the exact anchor strings from the current file state.
Changed files
npx/python/uv.locktests/test_output_formatter.pyVerification