Skip to content

Fix mypy errors from typed pytimeparse - #256

Merged
hoffmang9 merged 1 commit into
mainfrom
fix-mypy-test-init
Oct 27, 2026
Merged

hoffmang9 merged 1 commit into
mainfrom
fix-mypy-test-init

Conversation

@hoffmang9

@hoffmang9 hoffmang9 commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

pytimeparse now ships type hints, so the pre-commit mypy hook fails on every PR (unused type: ignore and None / float in Network.skip_time). Remove the stale ignore, raise ValueError for unparseable durations, and add a test.


Note

Low Risk
Test-harness-only typing and input validation; no production or security paths affected.

Overview
Fixes mypy failures after pytimeparse gained type stubs: drops the obsolete # type: ignore on the import and handles parse() returning None in Network.skip_time by raising ValueError instead of passing None into arithmetic.

Adds test_skip_time_invalid_duration to assert invalid duration strings fail with ValueError.

Reviewed by Cursor Bugbot for commit 2dac479. Bugbot is set up for automated code reviews on this repo. Configure here.

@ibutterbot ibutterbot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look correct: drops the stale type: ignore, handles parse()→None with a clear ValueError, and the new test covers invalid input. Clean and minimal.

The macOS 3.11 Intel CI failure is a transient runner network issue (couldn't resolve index.crates.io while building cryptography from source) — unrelated to this PR.

@hoffmang9
hoffmang9 merged commit a54cfac into main Oct 27, 2026
39 of 40 checks passed
@hoffmang9
hoffmang9 deleted the fix-mypy-test-init branch October 27, 2026 17:51
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.

2 participants