Fix junitxml count for teardown errors#14501
Merged
nicoddemus merged 8 commits intoMay 24, 2026
Merged
Conversation
nicoddemus
requested changes
May 23, 2026
Member
nicoddemus
left a comment
There was a problem hiding this comment.
Thanks, left some comments!
Use run_and_parse for the teardown regression and assert the testsuite count matches emitted testcase nodes. Keep the teardown-only adjustment only for the pass-plus-teardown-error case where both reports share a testcase node. Co-authored-by: OpenAI GPT-5 <noreply@openai.com>
2a63e72 to
549f134
Compare
Contributor
Author
|
Rebased onto current Verification run locally: uv run --with-editable . --extra dev python -m pytest testing/test_junitxml.py testing/test_unittest.py::test_setup_inheritance_skipping testing/test_unittest.py::test_pdb_teardown_skipped_for_classes testing/test_debugging.py::TestPDB::test_pdb_unittest_skip -q --junitxml=/tmp/pytest-14501-after-rebase.xml
# 142 passed, 3 skipped |
Rely on the shared run_and_parse testcase-count invariant instead of keeping a duplicate teardown regression with the same fixture shape. Co-authored-by: OpenAI GPT-5 <noreply@openai.com>
Contributor
Author
|
The current head addresses the review comments:
Latest local check after the rebase was 142 passed, 3 skipped for |
nicoddemus
approved these changes
May 24, 2026
Co-authored-by: Bruno Oliveira <bruno@soliv.dev>
for more information, see https://pre-commit.ci
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.
Fixes #3850
Summary
testscount when a test passes during call but fails during teardownrun_and_parsethat the testsuitetestsattribute matches the emitted<testcase>nodesTests
.venv/bin/python -m pytest testing/test_junitxml.py -q.venv/bin/pre-commit run --color never --files src/_pytest/junitxml.py testing/test_junitxml.py changelog/3850.bugfix.rstgit diff --checkAI assistance was used while iterating on the patch and tests. I reviewed the change and can explain it.