-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Fix Python 3.13 compatibility in events dumper #9826
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
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. |
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
|
only 8 checks are failing now. seems mainly redis only |
|
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) |
|
wow interesting! |
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