From b6c9113fe34ad21dfa82964e7067144640f74dd5 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 9 Oct 2024 09:35:03 +0300 Subject: [PATCH] Skip tests on macOS. --- Lib/test/test__locale.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Lib/test/test__locale.py b/Lib/test/test__locale.py index 81e59e5117a458..02d2acc6d1c417 100644 --- a/Lib/test/test__locale.py +++ b/Lib/test/test__locale.py @@ -200,17 +200,21 @@ def test_alt_digits_nl_langinfo(self): # Test nl_langinfo(ALT_DIGITS) tested = False for loc, (count, samples) in known_alt_digits.items(): - try: - setlocale(LC_TIME, loc) - except Error: - continue with self.subTest(locale=loc): - alt_digits = nl_langinfo(locale.ALT_DIGITS) - self.assertIsInstance(alt_digits, tuple) - self.assertEqual(len(alt_digits), count) - for i in samples: - self.assertEqual(alt_digits[i], samples[i]) - tested = True + try: + setlocale(LC_TIME, loc) + except Error: + self.skipTest(f'no locale {loc!r}') + continue + with self.subTest(locale=loc): + alt_digits = nl_langinfo(locale.ALT_DIGITS) + self.assertIsInstance(alt_digits, tuple) + if count and not alt_digits and sys.platform == 'darwin': + self.skipTest(f'ALT_DIGITS is not set for locale {loc!r} on macOS') + self.assertEqual(len(alt_digits), count) + for i in samples: + self.assertEqual(alt_digits[i], samples[i]) + tested = True if not tested: self.skipTest('no suitable locales')