Skip to content

test: fix pyright strict-mode errors in tests/test_observable/ (batch 1)#780

Merged
dbrattli merged 1 commit intomasterfrom
repo-assist/pyright-cleanup-test-observable-2026-04-24-5ff1a58fa16f34b4
Apr 25, 2026
Merged

test: fix pyright strict-mode errors in tests/test_observable/ (batch 1)#780
dbrattli merged 1 commit intomasterfrom
repo-assist/pyright-cleanup-test-observable-2026-04-24-5ff1a58fa16f34b4

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 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 remove tests/test_observable/ from the [tool.pyright] exclude list in pyproject.toml.

Errors fixed: ~40 across 16 files

Patterns Fixed

Pattern Files affected
Add (ex: Exception) -> None annotation to _raise helper test_combinelatest, test_empty, test_interval, test_repeat, test_throw, test_timer
Delete unused _raise helper function test_blocking, test_sample, test_throttlefirst
Add (ex: Exception) -> None to on_error callback test_flatmap_async
Add type annotations to predicate, comparer, __init__ test_count, test_contains, test_pluck
Fix float vs int for TestScheduler ticks test_timer (250.0 → 250)
Remove unused import test_utility_fluent (import pytest)
Replace unused variable with _ test_windowing_fluent (evens, odds_, odds)
Add # type: ignore[assignment] for single_or_default_async test_filtering_fluent (6 lines) — the default_value: _T = None parameter widens _T to include None, causing Observable[int | None] to be inferred where Observable[int] is declared

Notes

Testing

CI will validate with uv run pytest, uv run pyright, and uv run ruff check.

Note

🔒 Integrity filter blocked 29 items

The following items were blocked because they don't meet the GitHub integrity level.

  • Exceptions get silently dropped when using from_iterable() #563 list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #749 list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #748 list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #742 list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #736 list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #711 list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #700 list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #698 list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #634 list_pull_requests: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • #563 issue_read: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • Missing tap operator #750 list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • Python 3.14 Support #737 list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • AsyncIOScheduler.now returns a datetime in 1970. #734 list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • Offering help with Unit Tests #730 list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • Schedulers using different now() implementation breaks schedule_absolute() compatibility. #724 list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • Lack of concat_map / concat_all #723 list_issues: has lower integrity than agent requires. The agent cannot read data with integrity below "approved".
  • ... and 13 more items

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
  github:
    min-integrity: approved  # merged | approved | unapproved | none

Generated by Repo Assist · ● 9.6M ·

…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>
@dbrattli dbrattli changed the title [Repo Assist] test: fix pyright strict-mode errors in tests/test_observable/ (batch 1) test: fix pyright strict-mode errors in tests/test_observable/ (batch 1) Apr 25, 2026
@dbrattli dbrattli marked this pull request as ready for review April 25, 2026 08:18
@dbrattli dbrattli merged commit 0415770 into master Apr 25, 2026
8 checks passed
@dbrattli dbrattli deleted the repo-assist/pyright-cleanup-test-observable-2026-04-24-5ff1a58fa16f34b4 branch April 25, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant