Skip to content

[codex] Fix line wrapping for commented implicit strings#109

Draft
2830500285 wants to merge 1 commit into
pytest-dev:mainfrom
2830500285:codex/fix-comment-line-wrapping
Draft

[codex] Fix line wrapping for commented implicit strings#109
2830500285 wants to merge 1 commit into
pytest-dev:mainfrom
2830500285:codex/fix-comment-line-wrapping

Conversation

@2830500285

Copy link
Copy Markdown

Summary

Fixes conversion of self.assertEqual(...) calls when an implicitly concatenated multi-line string contains an inline comment. The previous line-wrapping step could add backslash continuations to comment lines, producing invalid Python.

This changes the fixer to wrap generated assert expressions in parentheses when the expression contains comment-prefixed leaves, allowing Python implicit continuation to preserve comments safely.

Validation

  • .venv/bin/python -m pytest -q
  • git diff --check

Local result: 36 passed, 1 skipped, 16 warnings.

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