Repository navigation
chore(deps): hold pytest below 9.2 (with the reason and the fix path) - #10
Merged
Merged
Conversation
pytest 9.2 breaks every test that monkeypatches a pydantic PrivateAttr on Settings: monkeypatch's undo calls pydantic's __delattr__, which raises when the key is not in __pydantic_private__. Reproduced on #9's tree: 53 passed on 9.1.1, 1 passed + 52 errors on 9.2.0, all in the autouse _clean fixture (tests/unit/test_sandbox_org.py). An ignore keeps the bump from reopening every week. The real fix, when someone wants 9.2, is in that module's _patch_all(): set and restore through obj.__pydantic_private__ instead of monkeypatch.setattr. Co-Authored-By: Claude Code <noreply@anthropic.com>
nonagenticai-claude
Bot
requested a review
from georgiedekker
as a code owner
November 14, 2026 08:49
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.
Dependabot #9 (pytest 9.1.1 → 9.2.0) is closed, not merged, because 9.2 is incompatible with how
our tests patch pydantic private attributes.
Reproduced on that PR's tree —
uv run --with pytest==9.2.0 pytest tests/unit/test_sandbox_org.py:All errors are in the autouse
_cleanfixture, on teardown:_patch_all()monkeypatches pydanticPrivateAttrs (_sandbox_owners,_platform_repo_grants, …) on theSettingsinstance. Under 9.2 the monkeypatch undo takespydantic's
__delattr__path, which raises when the key is not in__pydantic_private__.This PR adds
ignore: pytest >=9.2with the evidence in the comment, so the bump stops reopeningweekly. It is a hold, not a fix: the real fix is
_patch_all()setting and restoring throughobj.__pydantic_private__instead ofmonkeypatch.setattr, and the comment says so.🤖 Generated with Claude Code