Repository navigation
Fix hidden traceback frames in custom test items - #15256
jwalith4418-Mj wants to merge 2 commits 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>
OKAN-SOFTWARE
left a comment
There was a problem hiding this comment.
Reviewed commit 62d32fc against issue #7692.
The change correctly applies the existing traceback-filtering mechanism to custom test items. This allows frames marked with __tracebackhide__ to be excluded from normal failure output.
The --full-trace behavior remains intact because _repr_failure_py explicitly disables traceback filtering when that option is enabled.
The regression tests cover both ValueError and pytest.fail with and without --full-trace, and the GitHub test workflow passed.
Non-blocking suggestion:
Consider adding a regression assertion confirming that an ordinary, unmarked custom-item traceback frame remains visible after filtering.
The current tests verify removal of marked frames and preservation under --full-trace. An additional control would help guard against unintentionally filtering unrelated frames in future changes.
I have not independently rerun the test suite.
No blocking issue found within the reviewed scope.
Check the runtest frame in all four existing hidden-frame regression cases, including both failure paths and --full-trace settings. Co-authored-by: OpenAI Codex <noreply@openai.com>
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.