Skip to content

Commit b6c9113

Browse files
Skip tests on macOS.
1 parent 2e7fe7b commit b6c9113

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

Lib/test/test__locale.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -200,17 +200,21 @@ def test_alt_digits_nl_langinfo(self):
200200
# Test nl_langinfo(ALT_DIGITS)
201201
tested = False
202202
for loc, (count, samples) in known_alt_digits.items():
203-
try:
204-
setlocale(LC_TIME, loc)
205-
except Error:
206-
continue
207203
with self.subTest(locale=loc):
208-
alt_digits = nl_langinfo(locale.ALT_DIGITS)
209-
self.assertIsInstance(alt_digits, tuple)
210-
self.assertEqual(len(alt_digits), count)
211-
for i in samples:
212-
self.assertEqual(alt_digits[i], samples[i])
213-
tested = True
204+
try:
205+
setlocale(LC_TIME, loc)
206+
except Error:
207+
self.skipTest(f'no locale {loc!r}')
208+
continue
209+
with self.subTest(locale=loc):
210+
alt_digits = nl_langinfo(locale.ALT_DIGITS)
211+
self.assertIsInstance(alt_digits, tuple)
212+
if count and not alt_digits and sys.platform == 'darwin':
213+
self.skipTest(f'ALT_DIGITS is not set for locale {loc!r} on macOS')
214+
self.assertEqual(len(alt_digits), count)
215+
for i in samples:
216+
self.assertEqual(alt_digits[i], samples[i])
217+
tested = True
214218
if not tested:
215219
self.skipTest('no suitable locales')
216220

0 commit comments

Comments
 (0)