Skip to content

Commit

Permalink
Use timezone.utc
Browse files Browse the repository at this point in the history
Use assertIs().
  • Loading branch information
ZackerySpytz authored and pganssle committed Sep 23, 2020
1 parent e018229 commit 83db28d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Lib/test/datetimetester.py
Original file line number Diff line number Diff line change
Expand Up @@ -5992,7 +5992,7 @@ class DateTimeSubclass(datetime):
for klass in [datetime, DateTimeSubclass]:
for args in [(1993, 8, 26, 22, 12, 55, 99999),
(1993, 8, 26, 22, 12, 55, 99999,
FixedOffset(0, "UTC", -2))]:
timezone.utc)]:
d = klass(*args)
with self.subTest(cls=klass, date=args):
hour, minute, second, microsecond, tzinfo = \
Expand All @@ -6002,15 +6002,15 @@ class DateTimeSubclass(datetime):
self.assertEqual(minute, d.minute)
self.assertEqual(second, d.second)
self.assertEqual(microsecond, d.microsecond)
self.assertEqual(tzinfo, d.tzinfo)
self.assertIs(tzinfo, d.tzinfo)

def test_PyDateTime_TIME_GET(self):
class TimeSubclass(time):
pass

for klass in [time, TimeSubclass]:
for args in [(12, 30, 20, 10),
(12, 30, 20, 10, FixedOffset(0, "UTC", -2))]:
(12, 30, 20, 10, timezone.utc)]:
d = klass(*args)
with self.subTest(cls=klass, date=args):
hour, minute, second, microsecond, tzinfo = \
Expand All @@ -6020,7 +6020,7 @@ class TimeSubclass(time):
self.assertEqual(minute, d.minute)
self.assertEqual(second, d.second)
self.assertEqual(microsecond, d.microsecond)
self.assertEqual(tzinfo, d.tzinfo)
self.assertIs(tzinfo, d.tzinfo)

def test_timezones_offset_zero(self):
utc0, utc1, non_utc = _testcapi.get_timezones_offset_zero()
Expand Down

0 comments on commit 83db28d

Please sign in to comment.