Repository navigation
Conversation
Add tests to the pyright include in the type-checking tox env, previously only src and tests/unit_tests/core/test_status_types.py were checked. Fix the errors this exposes with corrected annotations, casts and narrowing, and use rule-specific pyright ignores where a test deliberately passes a bad value or touches an untyped backend. Assisted-by: Claude Opus 5.5
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.
Makes
tox -e type-checkingrun pyright over the wholetestsdirectory, not justsrcandtests/unit_tests/core/test_status_types.py, as suggested in review of bluesky#1473.Before the change pyright reported 289 errors over
srcplustests; it now reports 0, and the unit test count is unchanged (1015 passed, 2 skipped, 1 xfailed).What changed
pyproject.toml: the pyright include liststestsinstead of the single test file.CLAUDE.mdgets the matching ad hoc command.# pyright: ignore[reportXxx]comments, no blanket ignores and no settings loosened. They fall into two groups: tests that deliberately pass a bad value to check a runtime error (reportArgumentType,reportCallIssue), and attributes or types that are only known at runtime, mostly Tango proxies and mocks (reportAttributeAccessIssue,reportInvalidTypeForm).How to review
Start with the
pyproject.tomlandCLAUDE.mdhunks, then skim the test diffs by directory. Each ignore names its rule, so grep forpyright: ignoreto audit them.AI Disclaimer
The code and this description were generated with AI and reviewed/tweaked by the author.