Skip to content

fix(cli): drop dead datetime branches and tidy test type suppressions - #796

Merged
janbjorge merged 2 commits into
mainfrom
typing/08-findings
Sep 6, 2026
Merged

fix(cli): drop dead datetime branches and tidy test type suppressions#796
janbjorge merged 2 commits into
mainfrom
typing/08-findings

Conversation

@janbjorge

Copy link
Copy Markdown
Owner

Part 8/9 of the strict-mypy series. Stacked on #795; merge in order, I rebase the rest after each merge.

Three findings from mypy's warn_unreachable and truthy-bool checks,
fixed ahead of turning them on: the schedule table in pgq guarded
non-Optional datetimes with if x.heartbeat else "", so the fallback
could never run; asyncio_run() put the Windows branches after an
unconditional return that mypy proves always taken on the checking
platform, so they are now inside the platform check; and a test
dropped the handle of a create_task() it relied on.

Tests monkeypatch methods on managers throughout, so the test override
disables mypy's method-assign code instead of suppressing every site,
and the remaining # type: ignore comments carry an error code.

@janbjorge
janbjorge force-pushed the typing/08-findings branch 2 times, most recently from 1e67cad to f22bac8 Compare September 6, 2026 18:24
Base automatically changed from typing/07-event-router to main September 6, 2026 18:43
Three findings from mypy's warn_unreachable and truthy-bool checks,
fixed ahead of turning them on: the schedule table in `pgq` guarded
non-Optional datetimes with `if x.heartbeat else ""`, so the fallback
could never run; asyncio_run() put the Windows branches after an
unconditional return that mypy proves always taken on the checking
platform, so they are now inside the platform check; and a test
dropped the handle of a create_task() it relied on.

Tests monkeypatch methods on managers throughout, so the test override
disables mypy's method-assign code instead of suppressing every site,
and the remaining `# type: ignore` comments carry an error code.
@janbjorge
janbjorge merged commit ead95a2 into main Sep 6, 2026
20 checks passed
@janbjorge
janbjorge deleted the typing/08-findings branch September 6, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant