terminal: add --name-only option to show only names of failed tests#14451
Open
Vlor999 wants to merge 5 commits into
Open
terminal: add --name-only option to show only names of failed tests#14451Vlor999 wants to merge 5 commits into
Vlor999 wants to merge 5 commits into
Conversation
Add a new CLI argument --name-only that displays only the test name or collection error headline when a test fails. This is useful for quickly identifying failures in large test suites without the noise of full tracebacks or capture sections. - Register --name-only in pytest_addoption. - Modify summary_failures_combined and summary_errors to honor the flag. - Add regression tests in testing/test_name_only.py.
Co-authored-by: Gemini CLI <gemini-cli@google.com>
for more information, see https://pre-commit.ci
Nay-on
reviewed
Jun 15, 2026
| @@ -0,0 +1,94 @@ | |||
| from __future__ import annotations | |||
There was a problem hiding this comment.
The PR tests --name-only with --tb=line, but what about other combinations like --name-only with --show-capture=no or with verbose flags? Consider adding a test that ensures these play nicely together => Add tests for combinations like --name-only -v and document expected behavior
| help="Controls how captured stdout/stderr/log is shown on failed tests. " | ||
| "Default: all.", | ||
| ) | ||
| group.addoption( |
There was a problem hiding this comment.
The --tb=line case doesn't fully honor --name-only intent. The crash line message is still displayed
Author
|
Thanks for the review. I pushed a follow-up that makes |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add --name-only option to show only names of failed tests
Add a new CLI argument
--name-onlythat displays only the test name or collection error headline when a test fails. This is useful for quickly identifying failures in large test suites without the noise of full tracebacks or capture sections.--name-onlyinpytest_addoption.summary_failures_combinedandsummary_errorsto honor the flag.doc/en/reference/reference.rst.testing/test_name_only.py.changelog/14443.feature.rst.AUTHORS.Closes: #14452