Repository navigation
Conversation
Retain repaired tests alongside unresolved failures until the entire group completes acceptably in one successful session. Preserve ordinary last-failed cache semantics and handle partial selections conservatively. Add regression tests, documentation, and a changelog entry for issue pytest-dev#1017. Assisted-by: OpenAI Codex (GPT-6 family; exact model variant unavailable) Assisted-by: ChatGPT (GPT-6.2)
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.
Summary
Addresses #1017.
Adds an opt-in
--lf-keepmodifier for--lfthat retains previously failing tests until the entire failure group completes acceptably in one successful session.Currently, ordinary
--lfremoves repaired tests from the last-failed cache individually. This can cause subsequent reruns to miss regressions in previously repaired tests while other failures remain unresolved.Usage:
pytest --lf --lf-keepImplementation
cache/lastfailed_groupentry without changing ordinary last-failed cache semantics.Testing
Added 23 regression test cases.
tox -e lintingtox -e docsBoth full test suites completed with exit code 0.
Limitations and design considerations
Deleted or renamed retained node IDs are conservatively preserved until cache clearing.
Basic retained-group execution was tested with pytest-xdist using two local workers. However, recovery from previously failing collectors can leave collector placeholders cached because successful collection reports containing the recovered children are not available to the controller.
Ordinary distributed collector-cache persistence was also reproduced against unchanged upstream code. The retained-mode limitation is documented.
Feedback on the proposed CLI interface, same-session expiry semantics, and distributed recovery scope is welcome.
AI assistance
OpenAI Codex (GPT-6 model family, exact variant unavailable) and ChatGPT (GPT-6.2) assisted with research, design, implementation, testing, debugging, and documentation.
AI attribution is also included in the commit message. I will take responsibility for reviewing the contribution and responding to feedback.
This contribution was developed as part of a University of Michigan software engineering course.