[Repo Assist] test: fix pyright strict-mode errors in tests/test_scheduler/; remove from pyright exclude
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5k
- Forks
- 365
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 4
Description
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
This is Stage 3 of the test linting plan (see TEST_LINTING_PLAN.md): add pyright strict-mode type annotations to all 14 test files in tests/test_scheduler/ so the directory can be removed from pyright's exclude list.
Changes
14 test files annotated
- Added
-> Nonereturn types to all test methods and__init__methods - Typed all
action(scheduler, state)callbacks:(abc.SchedulerBase, Any) -> abc.DisposableBase | None - Typed all
handler(_)callbacks:(_: Exception) -> bool - Typed periodic action callbacks with appropriate state types
- Added
from typing import Anyandfrom reactivex import abcimports where needed - Typed
CatchSchedulerTestSchedulerclass attributes and overridden methods - Typed
Timestampedhelper class and module-level helper functions intest_historicalscheduler.py - Typed nested action functions throughout
pyproject.toml
- Removed
"tests/test_scheduler"from the[tool.pyright]exclude list - Added
"tests/test_scheduler/test_mainloop"(GUI library tests stay excluded — they require external dependencies like tkinter, gtk, wx, etc.)
What's excluded and why
tests/test_scheduler/test_mainloop/ remains excluded — these tests require optional GUI libraries (tkinter, gtk, wx, qt, etc.) not available in CI, and fixing them would require conditional imports.
Testing
All 115 scheduler tests pass (16 skipped as expected for flaky CI tests). CI will run the full suite via uv run pytest and validate types with uv run pyright.
Progress toward full test suite coverage:
- ✅ Stage 1: test_core, test_disposables, test_testing
- ✅ Stage 2: test_integration, test_subject
- ✅ Stage 3: test_scheduler (this PR)
- ⏳ Stage 4: test_observable (142 files, in separate PR #778 for ruff; pyright still TODO)
[!WARNING]
Protected FilesThis was originally intended as a pull request, but the patch modifies protected files. These files may affect project dependencies, CI/CD pipelines, or agent behaviour. Please review the changes carefully before creating the pull request.
Click here to create the pull request once you have reviewed the changes
Protected files
pyproject.toml
To route changes like this to a review issue instead of blocking, configure protected-files: fallback-to-issue in your workflow configuration.
[!NOTE]
🔒 Integrity filter blocked 8 items
The following items were blocked because they don't meet the GitHub integrity level.
- #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".To allow these resources, lower
min-integrityin your GitHub frontmatter:tools: github: min-integrity: approved # merged | approved | unapproved | none
Generated by Repo Assist · ● 7.9M · ◷
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with TEST_LINTING_PLAN.md and inspect the 14 files under tests/test_scheduler/ alongside the [tool.pyright] section of pyproject.toml. Run uv run pytest on the scheduler tests and uv run pyright to identify the strict-mode errors. Done means the scheduler directory is no longer excluded, the GUI subdirectory remains excluded, and the stated tests and type checks pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa, tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100