diff options
author | Xavier de Gaye <xdegaye@users.sourceforge.net> | 2016-11-15 16:24:42 (GMT) |
---|---|---|
committer | Xavier de Gaye <xdegaye@users.sourceforge.net> | 2016-11-15 16:24:42 (GMT) |
commit | 43cf2efafcaa0de9b8656a8f52b8cfc1b5cff1e9 (patch) | |
tree | 6c99d8d56d7677c96a777322e01dc6242cd7b700 | |
parent | d178e69ad859703ae1873f5fc4ac3be357b7f8e4 (diff) | |
download | cpython-43cf2efafcaa0de9b8656a8f52b8cfc1b5cff1e9.zip cpython-43cf2efafcaa0de9b8656a8f52b8cfc1b5cff1e9.tar.gz cpython-43cf2efafcaa0de9b8656a8f52b8cfc1b5cff1e9.tar.bz2 |
Issue #26929: Skip some test_strptime tests failing on Android that
incorrectly formats %V or %G for the last or the first
incomplete week in a year
-rw-r--r-- | Lib/test/test_strptime.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_strptime.py b/Lib/test/test_strptime.py index 22eac32..2cf0926 100644 --- a/Lib/test/test_strptime.py +++ b/Lib/test/test_strptime.py @@ -472,11 +472,24 @@ class CalculationTests(unittest.TestCase): "Calculation of day of the week failed;" "%s != %s" % (result.tm_wday, self.time_tuple.tm_wday)) + if support.is_android: + # Issue #26929: strftime() on Android incorrectly formats %V or %G for + # the last or the first incomplete week in a year. + _ymd_excluded = ((1905, 1, 1), (1906, 12, 31), (2008, 12, 29), + (1917, 12, 31)) + _formats_excluded = ('%G %V',) + else: + _ymd_excluded = () + _formats_excluded = () + def test_week_of_year_and_day_of_week_calculation(self): # Should be able to infer date if given year, week of year (%U or %W) # and day of the week def test_helper(ymd_tuple, test_reason): for year_week_format in ('%Y %W', '%Y %U', '%G %V'): + if (year_week_format in self._formats_excluded and + ymd_tuple in self._ymd_excluded): + return for weekday_format in ('%w', '%u', '%a', '%A'): format_string = year_week_format + ' ' + weekday_format with self.subTest(test_reason, |