-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Use timezone aware datetime #7918
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7918 +/- ##
==========================================
+ Coverage 88.78% 88.82% +0.04%
==========================================
Files 296 304 +8
Lines 41320 41495 +175
==========================================
+ Hits 36687 36860 +173
- Misses 4633 4635 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modulo date vs datetime, this should help.
There'll still be a very brief window around midnight UTC when this could fail. I wonder if we should write a test helper named something like date_or_wait(dt: TimeDelta)
that will sleep if it's called within dt
of a date change, then return the next day. I think this could protect us from random failures.
We can use something like Freezgun to set a specific date too. The test I introduce follows the patterns of the existing test suite. The test for date is trivial & and go without it? |
Seems worth investigating, but what you've got here is fine. |
This might prevent errors like https://github.com/ietf-tools/datatracker/actions/runs/10786037653/job/29912248540#step:6:1902