Skip to content

Commit 88e1f69

Browse files
miss-islingtongkirchounote35
authored
[3.14] gh-129483: Make TestLocalTimeDisambiguation's time format locale independent (GH-142193) (#142258)
gh-129483: Make `TestLocalTimeDisambiguation`'s time format locale independent (GH-142193) * Change to update %c to the exact time format. --------- (cherry picked from commit 8392095) Co-authored-by: Kir Chou <148194051+gkirchou@users.noreply.github.com> Co-authored-by: Kir Chou <note351@hotmail.com>
1 parent d069edc commit 88e1f69

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Lib/test/datetimetester.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6137,21 +6137,21 @@ def test_vilnius_1941_fromutc(self):
61376137

61386138
gdt = datetime(1941, 6, 23, 20, 59, 59, tzinfo=timezone.utc)
61396139
ldt = gdt.astimezone(Vilnius)
6140-
self.assertEqual(ldt.strftime("%c %Z%z"),
6140+
self.assertEqual(ldt.strftime("%a %b %d %H:%M:%S %Y %Z%z"),
61416141
'Mon Jun 23 23:59:59 1941 MSK+0300')
61426142
self.assertEqual(ldt.fold, 0)
61436143
self.assertFalse(ldt.dst())
61446144

61456145
gdt = datetime(1941, 6, 23, 21, tzinfo=timezone.utc)
61466146
ldt = gdt.astimezone(Vilnius)
6147-
self.assertEqual(ldt.strftime("%c %Z%z"),
6147+
self.assertEqual(ldt.strftime("%a %b %d %H:%M:%S %Y %Z%z"),
61486148
'Mon Jun 23 23:00:00 1941 CEST+0200')
61496149
self.assertEqual(ldt.fold, 1)
61506150
self.assertTrue(ldt.dst())
61516151

61526152
gdt = datetime(1941, 6, 23, 22, tzinfo=timezone.utc)
61536153
ldt = gdt.astimezone(Vilnius)
6154-
self.assertEqual(ldt.strftime("%c %Z%z"),
6154+
self.assertEqual(ldt.strftime("%a %b %d %H:%M:%S %Y %Z%z"),
61556155
'Tue Jun 24 00:00:00 1941 CEST+0200')
61566156
self.assertEqual(ldt.fold, 0)
61576157
self.assertTrue(ldt.dst())
@@ -6161,22 +6161,22 @@ def test_vilnius_1941_toutc(self):
61616161

61626162
ldt = datetime(1941, 6, 23, 22, 59, 59, tzinfo=Vilnius)
61636163
gdt = ldt.astimezone(timezone.utc)
6164-
self.assertEqual(gdt.strftime("%c %Z"),
6164+
self.assertEqual(gdt.strftime("%a %b %d %H:%M:%S %Y %Z"),
61656165
'Mon Jun 23 19:59:59 1941 UTC')
61666166

61676167
ldt = datetime(1941, 6, 23, 23, 59, 59, tzinfo=Vilnius)
61686168
gdt = ldt.astimezone(timezone.utc)
6169-
self.assertEqual(gdt.strftime("%c %Z"),
6169+
self.assertEqual(gdt.strftime("%a %b %d %H:%M:%S %Y %Z"),
61706170
'Mon Jun 23 20:59:59 1941 UTC')
61716171

61726172
ldt = datetime(1941, 6, 23, 23, 59, 59, tzinfo=Vilnius, fold=1)
61736173
gdt = ldt.astimezone(timezone.utc)
6174-
self.assertEqual(gdt.strftime("%c %Z"),
6174+
self.assertEqual(gdt.strftime("%a %b %d %H:%M:%S %Y %Z"),
61756175
'Mon Jun 23 21:59:59 1941 UTC')
61766176

61776177
ldt = datetime(1941, 6, 24, 0, tzinfo=Vilnius)
61786178
gdt = ldt.astimezone(timezone.utc)
6179-
self.assertEqual(gdt.strftime("%c %Z"),
6179+
self.assertEqual(gdt.strftime("%a %b %d %H:%M:%S %Y %Z"),
61806180
'Mon Jun 23 22:00:00 1941 UTC')
61816181

61826182
def test_constructors(self):

0 commit comments

Comments
 (0)