Skip to content

Fix assertion summary width calculation - #15536

Open
vankudothuadhinaik wants to merge 2 commits into
pytest-dev:mainfrom
vankudothuadhinaik:contrib/pytest-15531-terminal-width
Open

vankudothuadhinaik wants to merge 2 commits into
pytest-dev:mainfrom
vankudothuadhinaik:contrib/pytest-15531-terminal-width

Conversation

@vankudothuadhinaik

Copy link
Copy Markdown

Fixes #15531.

Assertion comparison summaries currently use a fixed repr budget that can exceed the available terminal width. Pass the detected terminal width into the comparison formatter and account for the full E AssertionError: assert prefix. When no terminal reporter is available, retain the existing 80-column fallback.

The tests cover narrow and wide terminal widths and the no-reporter behavior. The focused assertion suite passes (210 tests), and Ruff checks pass for the changed Python files.

AI assistance was used to help implement and validate this contribution.

@pyba-chronographer pyba-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Dec 4, 2026

This branch has not been deployed

No deployments
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.

Assertion summary line ignores terminal width (and overflows 80 columns)

1 participant