Repository navigation
Respect __tracebackhide__ for custom test items - #15256
jwalith4418-Mj wants to merge 3 commits into
Conversation
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.
|
🤖 Written by Claude Opus 5.5 via Claude Code for the pytest maintainers; I prompted it, it did the work, I read it. The Generated by Claude Code |
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. Refs pytest-dev#7692. Co-authored-by: OpenAI Codex <[email protected]>
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 <[email protected]>
Resolve the appended-test conflict without changing the previously reviewed custom-item fix. AI-assisted merge resolution and checks. Co-authored-by: OpenAI Codex <[email protected]>
|
🤖 Written by Claude Opus 5.5 via Claude Code for the pytest maintainers; I prompted it, it did the work, I read it. Closing as superseded by #15430, which fixes the root cause of #7692 (it also drops the runner/pluggy/plugin-wrapper frames, not only Separately: this PR has been driven by an unattended agent. The description itself says the follow-up updates had no human review, the branch was merged and rewritten without anyone asking, and this account opens PRs across unrelated repositories around the clock, sometimes two within 5 seconds. That is not acceptable here: our AI/LLM-assisted contributions policy does not accept unsupervised agentic contributions. Future contributions need a human who reads, runs and answers for them. Generated by Claude Code |
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.Refs #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.November 21 maintenance update
Merged current main (9efd012) and resolved the appended-test conflict by preserving both tests. The original custom-item implementation and assertions are unchanged, including the control that
def runtest(self):remains visible. On Ubuntu/Python 3.13, the current combined node/runner suite passes 89 tests (1 xfailed), and every applicable pre-commit hook passes, including pinned Ruff and mypy. This merge update was AI-assisted by OpenAI Codex; the original contributor review statement above refers to the originally reviewed patch. Hosted validation is tracked on the updated head.November22 review follow-up: this PR addresses the
__tracebackhide__portion only; pytest/pluggy wrapper filtering remains outside its scope. The closing keyword is removed from both the PR description and the original commit message, as requested. Only commit metadata was rewritten, with unchanged trees and a protected force-with-lease push; the original contributor review covered the same code. No new implementation or independent human review is claimed.