Skip to content

Commit 83db28d

Browse files
ZackerySpytzpganssle
authored andcommitted
Use timezone.utc
Use assertIs().
1 parent e018229 commit 83db28d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Lib/test/datetimetester.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -5992,7 +5992,7 @@ class DateTimeSubclass(datetime):
59925992
for klass in [datetime, DateTimeSubclass]:
59935993
for args in [(1993, 8, 26, 22, 12, 55, 99999),
59945994
(1993, 8, 26, 22, 12, 55, 99999,
5995-
FixedOffset(0, "UTC", -2))]:
5995+
timezone.utc)]:
59965996
d = klass(*args)
59975997
with self.subTest(cls=klass, date=args):
59985998
hour, minute, second, microsecond, tzinfo = \
@@ -6002,15 +6002,15 @@ class DateTimeSubclass(datetime):
60026002
self.assertEqual(minute, d.minute)
60036003
self.assertEqual(second, d.second)
60046004
self.assertEqual(microsecond, d.microsecond)
6005-
self.assertEqual(tzinfo, d.tzinfo)
6005+
self.assertIs(tzinfo, d.tzinfo)
60066006

60076007
def test_PyDateTime_TIME_GET(self):
60086008
class TimeSubclass(time):
60096009
pass
60106010

60116011
for klass in [time, TimeSubclass]:
60126012
for args in [(12, 30, 20, 10),
6013-
(12, 30, 20, 10, FixedOffset(0, "UTC", -2))]:
6013+
(12, 30, 20, 10, timezone.utc)]:
60146014
d = klass(*args)
60156015
with self.subTest(cls=klass, date=args):
60166016
hour, minute, second, microsecond, tzinfo = \
@@ -6020,7 +6020,7 @@ class TimeSubclass(time):
60206020
self.assertEqual(minute, d.minute)
60216021
self.assertEqual(second, d.second)
60226022
self.assertEqual(microsecond, d.microsecond)
6023-
self.assertEqual(tzinfo, d.tzinfo)
6023+
self.assertIs(tzinfo, d.tzinfo)
60246024

60256025
def test_timezones_offset_zero(self):
60266026
utc0, utc1, non_utc = _testcapi.get_timezones_offset_zero()

0 commit comments

Comments
 (0)