Skip to content

[Repo Assist] test: fix pyright strict-mode errors in tests/test_scheduler/; remove from pyright exclude #779

Description

@github-actions

🤖 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 -> None return 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 Any and from reactivex import abc imports where needed
  • Typed CatchSchedulerTestScheduler class attributes and overridden methods
  • Typed Timestamped helper class and module-level helper functions in test_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:


Warning

Protected Files

This 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-integrity in your GitHub frontmatter:

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

Generated by Repo Assist · ● 7.9M ·

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions