Repository navigation
Fix hidden traceback frames in custom test items - #15256
Open
jwalith4418-Mj wants to merge 1 commit into
Open
jwalith4418-Mj wants to merge 1 commit into
jwalith4418-Mj wants to merge 1 commit into
Conversation
Custom items inherit Node's default traceback filter, which returned the traceback without applying __tracebackhide__. Use the existing filter so marked helper and internal frames are omitted unless full tracebacks are explicitly requested. Cover ValueError and pytest.fail through a public custom collector/item, with and without --full-trace. Add the changelog and contributor entry. Fixes pytest-dev#7692. Co-authored-by: OpenAI Codex <noreply@openai.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.
Custom test items inherit
Node._traceback_filter, which returns the traceback unchanged and exposes frames marked with__tracebackhide__. Apply the existing traceback filter so custom items honor that marker while--full-tracecontinues to show the full traceback. This does not remove unmarked framework frames.Fixes #7692.
The regression uses a custom collector/item and checks
ValueErrorandpytest.fail, each with and without--full-trace. It fails in the two normal-output cases on unchanged main and passes all four cases with the fix. Includes a changelog entry and AUTHORS update.Validation on Windows, Python 3.12.14:
python -m pytest -n 2 testing -q).AI assistance: OpenAI Codex (GPT-6) prepared the patch, tests, and this description and is credited in the commit trailer. The contributor confirmed reviewing and understanding commit
62d32fccfand taking responsibility for its submission.