FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

assertion/rewrite: fix test crash on assert failure with `terminalreporter` disabled by bluetech · Pull Request #14418 · pytest-dev/pytest · GitHub

assertion/rewrite: fix test crash on assert failure with terminalreporter disabled - #14418

Merged
bluetech merged 2 commits into
pytest-dev:mainfrom
bluetech:assert-no-terminalreporter
May 1, 2026
Merged

assertion/rewrite: fix test crash on assert failure with terminalreporter disabled#14418
bluetech merged 2 commits into
pytest-dev:mainfrom
bluetech:assert-no-terminalreporter

Conversation

Copy link
Copy Markdown
Member

Based on #14383. Replaces #14378 (see there for some context).

The config.get_terminal_writer() in assertrepr_compare (=> the function injected by assertion rewriting for every assert) requires the terminalreporter plugin, so it crashed when the plugin is disabled.

Fix #14377.

bluetech force-pushed the assert-no-terminalreporter branch from d84e6e3 to 54f8638 Compare April 25, 2026 18:55
psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Apr 25, 2026

nicoddemus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM!

bluetech added 2 commits May 1, 2026 10:32
Seems better to make the lower-level function more agnostic.
…orter` disabled

The `config.get_terminal_writer()` in `assertrepr_compare` (=> the
function injected by assertion rewriting for every `assert`) requires
the `terminalreporter` plugin, so it crashed when the plugin is
disabled.

Fix pytest-dev#14377.
bluetech force-pushed the assert-no-terminalreporter branch from 54f8638 to 4ee157d Compare May 1, 2026 07:32
bluetech enabled auto-merge May 1, 2026 07:33
bluetech merged commit 32dab33 into pytest-dev:main May 1, 2026
33 checks passed
bluetech deleted the assert-no-terminalreporter branch May 1, 2026 07:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

Config.get_terminal_writer() crashes with AssertionError when terminalreporter is unregistered (pytest-tap streaming + non-test file asserts)

2 participants


Back | FazBrowse Home | New Git URL