Fix Python 3.13 compatibility in events dumper#9826
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9826 +/- ##
=======================================
Coverage 78.62% 78.62%
=======================================
Files 153 153
Lines 19199 19199
Branches 2547 2547
=======================================
Hits 15095 15095
Misses 3811 3811
Partials 293 293
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
auvipy
approved these changes
Jul 24, 2025
0a6dcc2 to
a876a58
Compare
Replace deprecated datetime.utcfromtimestamp() with datetime.fromtimestamp() using timezone.utc. The deprecated method was removed in Python 3.12+. Also fix test timezone handling to create proper UTC timestamps and update assertions to expect timezone-aware datetime format. Fixes failing tests: - test_on_event_task_received - test_on_event_non_task
Member
|
only 8 checks are failing now. seems mainly redis only |
Member
Author
|
The unit tests passed on the CI but not locally: FAILED t/unit/events/test_dumper.py::test_on_event_task_received - AssertionError: assert 'worker1 [2024-01-01 12:00:00]' in 'worker1 [2024-01-01 10:00:00] task received mytask(abc) args=(1,) kwargs={} \n'
FAILED t/unit/events/test_dumper.py::test_on_event_non_task - AssertionError: assert 'worker1 [2024-01-01 12:00:00]' in 'worker1 [2024-01-01 10:00:00] started: foo=bar\n’Now local & CI are similar: 3.13-unit: OK (152.92=setup[1.81]+cmd[151.10] seconds) |
Member
|
wow interesting! |
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.
Replace deprecated datetime.utcfromtimestamp() with datetime.fromtimestamp() using timezone.utc. The deprecated method was removed in Python 3.12+.
Also fix test timezone handling to create proper UTC timestamps and update assertions to expect timezone-aware datetime format.
Fixes failing tests:
Originally contributed in #9711