Skip to content

Reject negative wait_fixed intervals at construction - #719

Open
Pitchfork-and-Torch wants to merge 3 commits into
jd:mainfrom
Pitchfork-and-Torch:cook/reject-negative-wait-fixed
Open

Pitchfork-and-Torch wants to merge 3 commits into
jd:mainfrom
Pitchfork-and-Torch:cook/reject-negative-wait-fixed

Conversation

@Pitchfork-and-Torch

Copy link
Copy Markdown

Summary

wait_fixed(-1) previously constructed successfully, then crashed mid-retry inside time.sleep with ValueError: sleep length must be non-negative. Validate wait >= 0 in wait_fixed.__init__ so callers get a clear error before any attempt. Zero remains valid (same as wait_none).

Test plan

  • test_wait_fixed_rejects_negative passes

Pitchfork-and-Torch and others added 3 commits September 18, 2026 02:15
time.sleep rejects negatives with ValueError mid-retry; validate in
wait_fixed.__init__ so callers get a clear error before any attempt.
Ruff format rejected the extra blank line after the test, which had been appended past the unittest main guard.
The module-level test tripped no-untyped-def on Python 3.14. It now returns None.

This branch has not been deployed

No deployments
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