Repository navigation
Show the phase of errors in the short test summary - #15317
Open
doubledare704 wants to merge 2 commits into
Open
doubledare704 wants to merge 2 commits into
doubledare704 wants to merge 2 commits into
Conversation
ERROR entries in the short test summary did not say whether the error happened in setup or teardown, so a teardown error of a passing test showed up as a bare "ERROR test_foo". Prefix them with "at <phase> of", matching how XFAIL entries are already rendered. Refs pytest-dev#1004 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Refs #1004.
ERRORentries in the short test summary don't say which phase they came from. For a test whose call passed but whose teardown raised,-rEshows:which, next to
1 passed, 1 error, makes it look like a different test errored.show_xfailedalready rendersXFAIL at teardown of <nodeid>; this does the same for errors coming from_get_line_with_reprcrash_message:This is the first prerequisite listed in #1004 (comment). Counts are unchanged; only the summary line text changes. Call failures and collection errors render exactly as before (the prefix is only added for
setup/teardown).Things worth a look in review:
ERROR <nodeid>out of the short summary will now seeERROR at <phase> of <nodeid>. Henceimprovementrather thanbugfix; happy to change the category if you'd prefer to flag it more strongly.test_teardown_with_test_also_failingnow only matches the line prefix for that reason.Added
test_error_extra_reporting_shows_phaseand updated the two existing expectations intest_terminal.pyandacceptance_test.py.Co-authored-bycommit trailers.changelogdirectory.AUTHORSin alphabetical order.🤖 Generated with Claude Code
Why this change adds the phase only for setup and teardown?
A failed call is always reported as FAILED and a failed setup/teardown as ERROR (default pytest_report_teststatus), so FAILED already implies the phase while ERROR was ambiguous between setup and teardown. It also matches the existing ERROR at {when} of header in the ERRORS section and the XFAIL summary format, and leaves FAILED lines (the most commonly parsed) untouched.