Python(feat): hierarchical pytest report tree (packages, modules, classes, parametrize)#570
Merged
alexluck-sift merged 8 commits intoMay 23, 2026
Conversation
Contributor
|
Python docs preview: https://sift-stack.github.io/sift/python/pr-570/ Deployed from |
93cfa1c to
74b8b05
Compare
5448db8 to
941d9c9
Compare
3ae545c to
c403740
Compare
941d9c9 to
a4ba332
Compare
Base automatically changed from
al/python/graceful-handle-missing-connection
to
al/python/feat/pytest-dev-branch
May 21, 2026 21:40
f3b259c to
a83fe7b
Compare
wei-qlu
approved these changes
May 22, 2026
1187fc6
into
al/python/feat/pytest-dev-branch
18 checks passed
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.
Summary
@pytest.mark.parametrizeaxes now each open a nested parent step automatically via a unified diff-stack mechanism. The oldmodule_substepfixture is removed; everything above the leaf is handled by one autouse_hierarchy_parentsfixture.node.nodeid(not justname), so two same-named ancestors reached via different paths (e.g.proj_a/utilsandproj_b/utilsin a monorepo) stay distinct in the report tree.sift_package_step,sift_module_step,sift_class_step,sift_parametrize_nesting(all defaulttrue). Frames stay in the diff for identity even when their layer is gated off.step.measurements_passedproperty onNewStepfor theassert step.measurements_passedend-of-test pattern: fails pytest when any bounds check on this step failed, without short-circuiting on individualmeasure(...)calls.ReportContext.__exit__(was draining inpytest_sessionfinishafter the import worker had already shut down, leaving parents stuckIN_PROGRESSin Sift).import-test-result-logbinary; replay failures emitSiftPytestStepDrainWarninginstead of a silentlogger.error.__exit__failures during teardown warn and continue; mid-session drains use a strict variant that re-raises so genuine invariant violations surface as test errors.python/examples/pytest_plugin/plus a newpytest_plugin_quickstart.mdmkdocs page that snippets the demo files.pytest_plugin.mdupdated for the new ini knobs.test_hierarchy.pypytester suite covers classes, nested classes, packages, opt-out flags, cross-path collisions, and the drain helper; integration test covers the newstep.measurements_passedproperty.