Skip to content

Commit bfa12aa

Browse files
PetrHeinzclaude
andcommitted
tests: replace deprecated datetime.utcfromtimestamp
datetime.utcfromtimestamp() is deprecated for removal. Use the timezone-aware datetime.fromtimestamp(ts, timezone.utc), which produces the identical UTC-aware value the assertion compares against. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 672eeb8 commit bfa12aa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎tests/test_frame.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_create_frame_happy_path(self):
1717
self.assertTrue(frame['dt'].endswith("+00:00"))
1818

1919
# Sent date matches log record date
20-
date_ref = datetime.datetime.utcfromtimestamp(log_record.created).replace(tzinfo=datetime.timezone.utc)
20+
date_ref = datetime.datetime.fromtimestamp(log_record.created, datetime.timezone.utc)
2121
date_sent = datetime.datetime.fromisoformat(frame['dt'])
2222
self.assertEqual(date_ref, date_sent)
2323

0 commit comments

Comments
 (0)