fix(cli): drop dead datetime branches and tidy test type suppressions - #796
Merged
Conversation
janbjorge
force-pushed
the
typing/08-findings
branch
from
September 6, 2026 16:37
f099e1d to
78d2808
Compare
janbjorge
force-pushed
the
typing/08-findings
branch
from
September 6, 2026 17:48
78d2808 to
1ca47ee
Compare
janbjorge
force-pushed
the
typing/08-findings
branch
2 times, most recently
from
September 6, 2026 18:24
1e67cad to
f22bac8
Compare
janbjorge
force-pushed
the
typing/08-findings
branch
from
September 6, 2026 18:31
f22bac8 to
4e839d7
Compare
janbjorge
force-pushed
the
typing/08-findings
branch
from
September 6, 2026 18:33
4e839d7 to
5ade9da
Compare
janbjorge
force-pushed
the
typing/08-findings
branch
from
September 6, 2026 18:38
5ade9da to
52e6ed0
Compare
janbjorge
force-pushed
the
typing/08-findings
branch
from
September 6, 2026 18:41
52e6ed0 to
2ed503e
Compare
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
force-pushed
the
typing/08-findings
branch
from
September 6, 2026 18:43
2ed503e to
4ae0c4f
Compare
janbjorge
added a commit
that referenced
this pull request
Sep 6, 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.
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
pgqguardednon-Optional datetimes with
if x.heartbeat else "", so the fallbackcould 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: ignorecomments carry an error code.