mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-37552: Skip failing tests in strptime/strftime with UCRT version 17763.615 (#14460)
A bug in MSVC UCRT version 17763.615 (which has been fixed in newer versions) is causing test failures in some strptime/strftime tests when the default code page is c65001. This change selectively skips the tests affected by this.
This commit is contained in:
parent
1b38922434
commit
9cd39b16e2
3 changed files with 32 additions and 1 deletions
|
@ -7,6 +7,7 @@ import re
|
|||
import os
|
||||
import sys
|
||||
from test import support
|
||||
from test.support import skip_if_buggy_ucrt_strfptime
|
||||
from datetime import date as datetime_date
|
||||
|
||||
import _strptime
|
||||
|
@ -135,6 +136,7 @@ class TimeRETests(unittest.TestCase):
|
|||
"%s does not have re characters escaped properly" %
|
||||
pattern_string)
|
||||
|
||||
@skip_if_buggy_ucrt_strfptime
|
||||
def test_compile(self):
|
||||
# Check that compiled regex is correct
|
||||
found = self.time_re.compile(r"%A").match(self.locale_time.f_weekday[6])
|
||||
|
@ -365,6 +367,7 @@ class StrptimeTests(unittest.TestCase):
|
|||
_strptime._strptime("-01:3030", "%z")
|
||||
self.assertEqual("Inconsistent use of : in -01:3030", str(err.exception))
|
||||
|
||||
@skip_if_buggy_ucrt_strfptime
|
||||
def test_timezone(self):
|
||||
# Test timezone directives.
|
||||
# When gmtime() is used with %Z, entire result of strftime() is empty.
|
||||
|
@ -489,6 +492,7 @@ class CalculationTests(unittest.TestCase):
|
|||
def setUp(self):
|
||||
self.time_tuple = time.gmtime()
|
||||
|
||||
@skip_if_buggy_ucrt_strfptime
|
||||
def test_julian_calculation(self):
|
||||
# Make sure that when Julian is missing that it is calculated
|
||||
format_string = "%Y %m %d %H %M %S %w %Z"
|
||||
|
@ -498,6 +502,7 @@ class CalculationTests(unittest.TestCase):
|
|||
"Calculation of tm_yday failed; %s != %s" %
|
||||
(result.tm_yday, self.time_tuple.tm_yday))
|
||||
|
||||
@skip_if_buggy_ucrt_strfptime
|
||||
def test_gregorian_calculation(self):
|
||||
# Test that Gregorian date can be calculated from Julian day
|
||||
format_string = "%Y %H %M %S %w %j %Z"
|
||||
|
@ -512,6 +517,7 @@ class CalculationTests(unittest.TestCase):
|
|||
self.time_tuple.tm_year, self.time_tuple.tm_mon,
|
||||
self.time_tuple.tm_mday))
|
||||
|
||||
@skip_if_buggy_ucrt_strfptime
|
||||
def test_day_of_week_calculation(self):
|
||||
# Test that the day of the week is calculated as needed
|
||||
format_string = "%Y %m %d %H %S %j %Z"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue