diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-10-21 19:17:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-21 19:17:39 (GMT) |
commit | 9dde4638e44639d45bd7d72e70a8d410995a585a (patch) | |
tree | bf9e023f444a06fbd1cd9b7f38b1c1a1ee49c816 /Lib/test/test_strptime.py | |
parent | dcc4fb2c9068f60353f0c0978948b7681f7745e6 (diff) | |
download | cpython-9dde4638e44639d45bd7d72e70a8d410995a585a.zip cpython-9dde4638e44639d45bd7d72e70a8d410995a585a.tar.gz cpython-9dde4638e44639d45bd7d72e70a8d410995a585a.tar.bz2 |
gh-53203: Fix test_strptime on Solaris (GH-125785)
Use fixed timezone.
Skip roundtrip tests on locales with 2-digit year.
Diffstat (limited to 'Lib/test/test_strptime.py')
-rw-r--r-- | Lib/test/test_strptime.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_strptime.py b/Lib/test/test_strptime.py index 09f6f65..9f5cfca 100644 --- a/Lib/test/test_strptime.py +++ b/Lib/test/test_strptime.py @@ -515,12 +515,17 @@ class StrptimeTests(unittest.TestCase): # NB: Dates before 1969 do not roundtrip on some locales: # az_IR, bo_CN, bo_IN, dz_BT, eu_ES, eu_FR, fa_IR, or_IN. + @support.run_with_tz('STD-1DST,M4.1.0,M10.1.0') @run_with_locales('LC_TIME', 'C', 'en_US', 'fr_FR', 'de_DE', 'ja_JP', 'he_IL', 'ar_AE', 'mfe_MU', 'yo_NG', 'csb_PL', 'br_FR', 'gez_ET', 'brx_IN', 'my_MM', 'shn_MM') def test_date_time_locale2(self): # Test %c directive + loc = locale.getlocale(locale.LC_TIME)[0] + if sys.platform.startswith('sunos'): + if loc in ('ar_AE',): + self.skipTest(f'locale {loc!r} may not work on this platform') self.roundtrip('%c', slice(0, 6), (1900, 1, 1, 0, 0, 0, 0, 1, 0)) self.roundtrip('%c', slice(0, 6), (1800, 1, 1, 0, 0, 0, 0, 1, 0)) @@ -553,6 +558,10 @@ class StrptimeTests(unittest.TestCase): 'eu_ES', 'ar_AE', 'my_MM', 'shn_MM') def test_date_locale2(self): # Test %x directive + loc = locale.getlocale(locale.LC_TIME)[0] + if sys.platform.startswith('sunos'): + if loc in ('en_US', 'de_DE', 'ar_AE'): + self.skipTest(f'locale {loc!r} may not work on this platform') self.roundtrip('%x', slice(0, 3), (1900, 1, 1, 0, 0, 0, 0, 1, 0)) self.roundtrip('%x', slice(0, 3), (1800, 1, 1, 0, 0, 0, 0, 1, 0)) |