Skip to content

fix: keep pytest_terminal_summary under --no-summary#14730

Open
l46983284-cpu wants to merge 1 commit into
pytest-dev:mainfrom
l46983284-cpu:fix/no-summary-keep-terminal-hook-14724
Open

fix: keep pytest_terminal_summary under --no-summary#14730
l46983284-cpu wants to merge 1 commit into
pytest-dev:mainfrom
l46983284-cpu:fix/no-summary-keep-terminal-hook-14724

Conversation

@l46983284-cpu

Copy link
Copy Markdown

Summary

--no-summary currently skips calling the pytest_terminal_summary hook entirely, which silences third-party plugins (e.g. pytest-cov) as well as pytest's own FAILURES/ERRORS sections.

This change always invokes the hook, but gates TerminalReporter's built-in summary sections on not no_summary, so:

  • pytest's own FAILURES/ERRORS/... stay hidden under --no-summary
  • plugins can still write their terminal summaries

Closes #14724

Test plan

  • TestTerminalFunctional::test_no_summary (FAILURES still suppressed)
  • new test_no_summary_still_runs_terminal_summary_hook
  • existing no_summary warning/collecterror tests

--no-summary was skipping the entire pytest_terminal_summary hook, which
silenced third-party plugins (e.g. coverage) as well as pytest's own
FAILURES/ERRORS sections. Still suppress TerminalReporter's built-in
summary body, but always call the hook so plugins can report.

Closes pytest-dev#14724

Signed-off-by: Alex Chen <l46983284@gmail.com>
@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Jul 19, 2026
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.

--no-summary disables the pytest_terminal_summary hook, silencing third-party plugins as well as pytest's own summary

1 participant