Skip to content

Commit 6bd637b

Browse files
committed
pythongh-149879: Fix test_strptime on Cygwin
Skip my_MM and or_IN locales on multiple tests, since the tests fail on Cygwin.
1 parent a5be25d commit 6bd637b

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lib/test/test_strptime.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,10 @@ def test_bad_timezone(self):
509509
'my_MM', 'or_IN', 'shn_MM', 'az_IR',
510510
'byn_ER', 'wal_ET', 'lzh_TW')
511511
def test_date_time_locale(self):
512+
loc = locale.getlocale(locale.LC_TIME)[0]
513+
if sys.platform == 'cygwin' and loc in ('my_MM', 'or_IN'):
514+
self.skipTest('test fails on Cygwin')
515+
512516
# Test %c directive
513517
loc = locale.getlocale(locale.LC_TIME)[0]
514518
if glibc_ver and glibc_ver < (2, 31) and loc == 'br_FR':
@@ -536,6 +540,10 @@ def test_date_time_locale(self):
536540
'csb_PL', 'br_FR', 'gez_ET', 'brx_IN',
537541
'my_MM', 'shn_MM')
538542
def test_date_time_locale2(self):
543+
loc = locale.getlocale(locale.LC_TIME)[0]
544+
if sys.platform == 'cygwin' and loc in ('my_MM',):
545+
self.skipTest('test fails on Cygwin')
546+
539547
# Test %c directive
540548
loc = locale.getlocale(locale.LC_TIME)[0]
541549
if sys.platform.startswith('sunos'):
@@ -550,6 +558,10 @@ def test_date_time_locale2(self):
550558
'he_IL', 'eu_ES', 'ar_AE',
551559
'az_IR', 'my_MM', 'or_IN', 'shn_MM', 'lzh_TW')
552560
def test_date_locale(self):
561+
loc = locale.getlocale(locale.LC_TIME)[0]
562+
if sys.platform == 'cygwin' and loc in ('my_MM', 'or_IN'):
563+
self.skipTest('test fails on Cygwin')
564+
553565
# Test %x directive
554566
now = time.time()
555567
self.roundtrip('%x', slice(0, 3), time.localtime(now))
@@ -567,6 +579,10 @@ def test_date_locale(self):
567579
@run_with_locales('LC_TIME', 'en_US', 'fr_FR', 'de_DE', 'ja_JP',
568580
'eu_ES', 'ar_AE', 'my_MM', 'shn_MM', 'lzh_TW')
569581
def test_date_locale2(self):
582+
loc = locale.getlocale(locale.LC_TIME)[0]
583+
if sys.platform == 'cygwin' and loc in ('my_MM',):
584+
self.skipTest('test fails on Cygwin')
585+
570586
# Test %x directive
571587
loc = locale.getlocale(locale.LC_TIME)[0]
572588
if sys.platform.startswith(('sunos', 'aix')):
@@ -587,6 +603,10 @@ def test_date_locale2(self):
587603
'ti_ET', 'tig_ER', 'wal_ET', 'lzh_TW',
588604
'ar_SA', 'bg_BG')
589605
def test_time_locale(self):
606+
loc = locale.getlocale(locale.LC_TIME)[0]
607+
if sys.platform == 'cygwin' and loc in ('or_IN',):
608+
self.skipTest('test fails on Cygwin')
609+
590610
# Test %X directive
591611
loc = locale.getlocale(locale.LC_TIME)[0]
592612
pos = slice(3, 6)

0 commit comments

Comments
 (0)