Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 83db28d

Browse filesBrowse files
ZackerySpytzpganssle
authored andcommitted
Use timezone.utc
Use assertIs().
1 parent e018229 commit 83db28d
Copy full SHA for 83db28d

File tree

1 file changed

+4
-4
lines changed
Filter options

1 file changed

+4
-4
lines changed

‎Lib/test/datetimetester.py

Copy file name to clipboardExpand all lines: Lib/test/datetimetester.py
+4-4Lines changed: 4 additions & 4 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.