Skip to content

Commit e68066e

Browse files
miss-islingtongkirchounote35
authored
[3.13] gh-129483: Make TestLocalTimeDisambiguation's time format locale independent (GH-142193) (#142259)
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 1a75c0f commit e68066e

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
@@ -5814,21 +5814,21 @@ def test_vilnius_1941_fromutc(self):
58145814

58155815
gdt = datetime(1941, 6, 23, 20, 59, 59, tzinfo=timezone.utc)
58165816
ldt = gdt.astimezone(Vilnius)
5817-
self.assertEqual(ldt.strftime("%c %Z%z"),
5817+
self.assertEqual(ldt.strftime("%a %b %d %H:%M:%S %Y %Z%z"),
58185818
'Mon Jun 23 23:59:59 1941 MSK+0300')
58195819
self.assertEqual(ldt.fold, 0)
58205820
self.assertFalse(ldt.dst())
58215821

58225822
gdt = datetime(1941, 6, 23, 21, tzinfo=timezone.utc)
58235823
ldt = gdt.astimezone(Vilnius)
5824-
self.assertEqual(ldt.strftime("%c %Z%z"),
5824+
self.assertEqual(ldt.strftime("%a %b %d %H:%M:%S %Y %Z%z"),
58255825
'Mon Jun 23 23:00:00 1941 CEST+0200')
58265826
self.assertEqual(ldt.fold, 1)
58275827
self.assertTrue(ldt.dst())
58285828

58295829
gdt = datetime(1941, 6, 23, 22, tzinfo=timezone.utc)
58305830
ldt = gdt.astimezone(Vilnius)
5831-
self.assertEqual(ldt.strftime("%c %Z%z"),
5831+
self.assertEqual(ldt.strftime("%a %b %d %H:%M:%S %Y %Z%z"),
58325832
'Tue Jun 24 00:00:00 1941 CEST+0200')
58335833
self.assertEqual(ldt.fold, 0)
58345834
self.assertTrue(ldt.dst())
@@ -5838,22 +5838,22 @@ def test_vilnius_1941_toutc(self):
58385838

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

58445844
ldt = datetime(1941, 6, 23, 23, 59, 59, tzinfo=Vilnius)
58455845
gdt = ldt.astimezone(timezone.utc)
5846-
self.assertEqual(gdt.strftime("%c %Z"),
5846+
self.assertEqual(gdt.strftime("%a %b %d %H:%M:%S %Y %Z"),
58475847
'Mon Jun 23 20:59:59 1941 UTC')
58485848

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

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

58595859
def test_constructors(self):

0 commit comments

Comments
 (0)