8000 gh-53203: Fix test_strptime on Solaris (GH-125785) · python/cpython@9dde463 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9dde463

Browse files
gh-53203: Fix test_strptime on Solaris (GH-125785)
Use fixed timezone. Skip roundtrip tests on locales with 2-digit year.
1 parent dcc4fb2 commit 9dde463

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Lib/test/test_strptime.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,12 +515,17 @@ def test_date_time_locale(self):
515515

516516
# NB: Dates before 1969 do not roundtrip on some locales:
517517
# az_IR, bo_CN, bo_IN, dz_BT, eu_ES, eu_FR, fa_IR, or_IN.
518+
@support.run_with_tz('STD-1DST,M4.1.0,M10.1.0')
518519
@run_with_locales('LC_TIME', 'C', 'en_US', 'fr_FR', 'de_DE', 'ja_JP',
519520
'he_IL', 'ar_AE', 'mfe_MU', 'yo_NG',
520521
'csb_PL', 'br_FR', 'gez_ET', 'brx_IN',
521522
'my_MM', 'shn_MM')
522523
def test_date_time_locale2(self):
523524
# Test %c directive
525+
loc = locale.getlocale(locale.LC_TIME)[0]
526+
if sys.platform.startswith('sunos'):
527+
if loc in ('ar_AE',):
528+
self.skipTest(f'locale {loc!r} may not work on this platform')
524529
self.roundtrip('%c', slice(0, 6), (1900, 1, 1, 0, 0, 0, 0, 1, 0))
525530
self.roundtrip('%c', slice(0, 6), (1800, 1, 1, 0, 0, 0, 0, 1, 0))
526531

@@ -553,6 +558,10 @@ def test_date_locale(self):
553558
'eu_ES', 'ar_AE', 'my_MM', 'shn_MM')
554559
def test_date_locale2(self):
555560
# Test %x directive
561+
loc = locale.getlocale(locale.LC_TIME)[0]
562+
if sys.platform.startswith('sunos'):
563+
if loc in ('en_US', 'de_DE', 'ar_AE'):
564+
self.skipTest(f'locale {loc!r} may not work on this platform')
556565
self.roundtrip('%x', slice(0, 3), (1900, 1, 1, 0, 0, 0, 0, 1, 0))
557566
self.roundtrip('%x', slice(0, 3), (1800, 1, 1, 0, 0, 0, 0, 1, 0))
558567

0 commit comments

Comments
 (0)
0