Fix beartype crash in pytest_collection_modifyitems on Windows#3098
Merged
adamtheturtle merged 1 commit intomainfrom Apr 8, 2026
Merged
Fix beartype crash in pytest_collection_modifyitems on Windows#3098adamtheturtle merged 1 commit intomainfrom
adamtheturtle merged 1 commit intomainfrom
Conversation
The pytest_collection_modifyitems hook in vuforia_backends.py had items typed as list[pytest.Function], but Sybil doctest items (SybilItem) are also collected and don't inherit from Function. The @beartype decorator enforced this at runtime, crashing the Windows CI with a BeartypeCallHintParamViolation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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_collection_modifyitemshook intests/mock_vws/fixtures/vuforia_backends.pytypeditemsaslist[pytest.Function], but Sybil doctest items (SybilItem) don't inherit fromFunction@beartypedecorator enforced this at runtime, causing aBeartypeCallHintParamViolationthat crashed the Windows CIlist[pytest.Item](matching the same hook inconftest.py)Test plan
🤖 Generated with Claude Code
Note
Low Risk
Low risk: a type-hint-only change to a pytest hook signature that affects runtime only via
beartypeand does not alter test behavior beyond avoiding collection-time crashes.Overview
Prevents a test-collection crash by widening the
pytest_collection_modifyitemshook parameter fromlist[pytest.Function]tolist[pytest.Item]intests/mock_vws/fixtures/vuforia_backends.py, so non-function items (e.g., doctest/Sybil items) pass@beartyperuntime checks.Reviewed by Cursor Bugbot for commit 6e79e64. Bugbot is set up for automated code reviews on this repo. Configure here.