Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3562 +/- ##
===============================================
Coverage 100.00000% 100.00000%
===============================================
Files 128 128
Lines 19479 19484 +5
Branches 1323 1323
===============================================
+ Hits 19479 19484 +5
🚀 New features to boost your workflow:
|
A5rocks
requested changes
Oct 27, 2026
A5rocks
left a comment
Contributor
There was a problem hiding this comment.
Please don't respond with LLM-generated comments or I will close this PR!
| @rate.setter | ||
| def rate(self, new_rate: float) -> None: | ||
| if new_rate < 0: | ||
| if not new_rate >= 0: # also rejects NaN |
Contributor
There was a problem hiding this comment.
Please make this explicit. math.isnan exists, we don't have to do stupid transformations on math to check for NaN! Also a better error message is possible.
This branch has not been deployed
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.
MockClock accepted a NaN rate because the check was
new_rate < 0, which is false for NaN, soMockClock(rate=float('nan')).current_time()returned nan. I changed the check so NaN raises the same ValueError as a negative rate, and added tests for both the constructor and the setter.