Skip to content

Fix beartype crash in pytest_collection_modifyitems on Windows#3098

Merged
adamtheturtle merged 1 commit intomainfrom
adamtheturtle/fix-ci-failure
Apr 8, 2026
Merged

Fix beartype crash in pytest_collection_modifyitems on Windows#3098
adamtheturtle merged 1 commit intomainfrom
adamtheturtle/fix-ci-failure

Conversation

@adamtheturtle
Copy link
Copy Markdown
Member

@adamtheturtle adamtheturtle commented Apr 8, 2026

Summary

  • The pytest_collection_modifyitems hook in tests/mock_vws/fixtures/vuforia_backends.py typed items as list[pytest.Function], but Sybil doctest items (SybilItem) don't inherit from Function
  • The @beartype decorator enforced this at runtime, causing a BeartypeCallHintParamViolation that crashed the Windows CI
  • Changed the type hint to list[pytest.Item] (matching the same hook in conftest.py)

Test plan

  • All pre-commit hooks pass (mypy, pyright, ty, pyrefly, ruff, etc.)
  • Windows CI passes

🤖 Generated with Claude Code


Note

Low Risk
Low risk: a type-hint-only change to a pytest hook signature that affects runtime only via beartype and does not alter test behavior beyond avoiding collection-time crashes.

Overview
Prevents a test-collection crash by widening the pytest_collection_modifyitems hook parameter from list[pytest.Function] to list[pytest.Item] in tests/mock_vws/fixtures/vuforia_backends.py, so non-function items (e.g., doctest/Sybil items) pass @beartype runtime checks.

Reviewed by Cursor Bugbot for commit 6e79e64. Bugbot is set up for automated code reviews on this repo. Configure here.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant