Skip to content

test: cover escape=False multiline strings with a leading newline - #694

Open
connabyss wants to merge 1 commit into
python-poetry:masterfrom
connabyss:test/raw-multiline-leading-newline
Open

connabyss wants to merge 1 commit into
python-poetry:masterfrom
connabyss:test/raw-multiline-leading-newline

Conversation

@connabyss

Copy link
Copy Markdown

Summary

#658 fixed #655 (a multiline string built with escape=False whose value starts with a newline got an extra blank line after the opening quotes). The merged fix has no test: with the tomlkit/items.py part of #658 taken out, the whole test suite still passes.

This adds the two cases from #655 to test_create_string, one basic and one literal multiline string. Both fail without the fix and pass with it. #656 (closed in favour of #658) had similar tests; this brings that coverage back on top of the merged fix.

I used Claude Code to run python -m pytest (1226 passed), plus ruff check and ruff format --check on the changed file.

Adds the missing test for #655.

Duplicate Check

Agent Drafting Metadata

  • Agent: Claude Code
  • Model: Claude
  • Notes: Gap found with Bite (github.com/connabyss/bite), which takes each change back out and checks whether any test fails. I used Claude Code to write the test and reviewed it.

python-poetry#658 fixed python-poetry#655 (an escape=False multiline string with a leading
newline got an extra blank line), but no test covers it: with the
items.py part of python-poetry#658 taken out, the whole suite still passes.

Add the two cases from the issue to test_create_string. Both fail
without the fix and pass with it.

Assisted-by: Claude Code
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.

Regression: impossible to dump multiline strings with leading newline

1 participant