Conversation
…able/ Fix pyright strict-mode type annotation errors in a batch of test files in tests/test_observable/ that have 5 or fewer errors each. This is the first step toward eventually removing tests/test_observable/ from the pyright exclude list in pyproject.toml. Patterns fixed: - Add type annotations to _raise helper (ex: Exception) -> None in 7 files - Delete unused _raise helper functions in 3 files - Add type annotations to on_error, predicate, comparer, __init__ functions - Fix float vs int ticks in TestScheduler assertions (test_timer) - Remove unused import (test_utility_fluent) - Replace unused variable with _ (test_windowing_fluent) - Add # type: ignore[assignment] for single_or_default_async return type mismatch caused by default_value: _T = None widening _T to include None Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
5 tasks
dbrattli
approved these changes
Apr 25, 2026
This was referenced Apr 26, 2026
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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
This PR fixes pyright strict-mode type annotation errors across 16 test files in
tests/test_observable/, targeting files with 5 or fewer errors each. This is batch 1 of the cleanup effort to eventually removetests/test_observable/from the[tool.pyright] excludelist inpyproject.toml.Errors fixed: ~40 across 16 files
Patterns Fixed
(ex: Exception) -> Noneannotation to_raisehelpertest_combinelatest,test_empty,test_interval,test_repeat,test_throw,test_timer_raisehelper functiontest_blocking,test_sample,test_throttlefirst(ex: Exception) -> Nonetoon_errorcallbacktest_flatmap_asyncpredicate,comparer,__init__test_count,test_contains,test_plucktest_timer(250.0 → 250)test_utility_fluent(import pytest)_test_windowing_fluent(evens, odds→_, odds)# type: ignore[assignment]forsingle_or_default_asynctest_filtering_fluent(6 lines) — thedefault_value: _T = Noneparameter widens_Tto includeNone, causingObservable[int | None]to be inferred whereObservable[int]is declaredNotes
pyproject.tomlis not modified in this PR; that change (removing the exclude entry) will follow once enough test files are clean# type: ignore[assignment]comments intest_filtering_fluentare a pragmatic fix. The root cause is thatsingle_or_default_async(default_value: _T = None)infers_T = int | Nonewhen no argument is given. A proper fix would require changing the operator's overloads, which is a separate concern.Testing
CI will validate with
uv run pytest,uv run pyright, anduv run ruff check.Note
🔒 Integrity filter blocked 29 items
The following items were blocked because they don't meet the GitHub integrity level.
list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".tapoperator #750list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".AsyncIOScheduler.nowreturns a datetime in 1970. #734list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".now()implementation breaksschedule_absolute()compatibility. #724list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".To allow these resources, lower
min-integrityin your GitHub frontmatter: