Skip to content

Preserve blank lines in option help text - #15021

Open
niukanen1 wants to merge 2 commits into
pytest-dev:mainfrom
niukanen1:fix/preserve-help-blank-lines
Open

Preserve blank lines in option help text#15021
niukanen1 wants to merge 2 commits into
pytest-dev:mainfrom
niukanen1:fix/preserve-help-blank-lines

Conversation

@niukanen1

@niukanen1 niukanen1 commented Sep 14, 2026

Copy link
Copy Markdown

Option help text already preserves explicit line breaks, but an empty line was
dropped because textwrap.wrap("") returns no output lines. This collapsed
separate help paragraphs in rendered pytest --help output.

Keep one empty formatted line for each empty input line. The integration
regression registers an option through pytest's Parser and verifies the
rendered help output. A formatter-level test also confirms that ordinary
nonempty wrapping is unchanged.

The contributor entry is included in AUTHORS, together with the numbered
changelog/15021.bugfix.rst entry.

Validation:

  • pytest testing/test_parseopt.py — 35 passed on the current base.
  • tox -e linting — passed on the current base.
  • tox -e py313 — 4585 passed, 51 skipped, 15 xfailed, 5 xpassed on base a315b97. The subsequent rebase adds only upstream integration-plugin dependency pins; the code patch is unchanged.
  • The changelog fragment passed its applicable pre-commit hooks.

@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Sep 14, 2026
@niukanen1
niukanen1 marked this pull request as ready for review September 14, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant