Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix testing br_FR on old glibc.
  • Loading branch information
serhiy-storchaka committed Oct 12, 2024
commit f64b374f4fb555c61ae777e83526710517e6f257
13 changes: 12 additions & 1 deletion Lib/test/test_strptime.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import locale
import re
import os
import platform
import sys
from test import support
from test.support import warnings_helper
Expand All @@ -13,6 +14,13 @@

import _strptime

libc_ver = platform.libc_ver()
if libc_ver[0] == 'glibc':
glibc_ver = tuple(map(int, libc_ver[1].split('.')))
else:
glibc_ver = None


class getlang_Tests(unittest.TestCase):
"""Test _getlang"""
def test_basic(self):
Expand Down Expand Up @@ -482,9 +490,12 @@ def test_bad_timezone(self):
# for az_IR, fa_IR, lzh_TW, my_MM, or_IN, shn_MM.
@run_with_locales('LC_TIME', 'C', 'en_US', 'fr_FR', 'de_DE', 'ja_JP',
'he_IL', 'eu_ES', 'ar_AE', 'mfe_MU', 'yo_NG',
'csb_PL', 'br_FR', 'gez_ET', 'brx_IN')
'csb_PL', 'br_FR', 'gez_ET', 'brx_IN', 'id_ID')
def test_date_time_locale(self):
# Test %c directive
loc = locale.getlocale(locale.LC_TIME)[0]
if glibc_ver and glibc_ver < (2, 31) and loc == 'br_FR':
self.skipTest('%c in locale br_FR does not include time')
now = time.time()
self.roundtrip('%c', slice(0, 6), time.localtime(now))
# 1 hour 20 minutes 30 seconds ago
Expand Down