mirror of https://github.com/python/cpython.git
Also set LC_CTYPE, to allow localeconv string conversion.
This commit is contained in:
parent
48b98ded6e
commit
fe92d0b081
|
@ -1,5 +1,5 @@
|
|||
from test.test_support import verbose, TestSkipped, run_unittest
|
||||
from _locale import (setlocale, LC_NUMERIC, RADIXCHAR, THOUSEP, nl_langinfo,
|
||||
from _locale import (setlocale, LC_ALL, LC_CTYPE, LC_NUMERIC, RADIXCHAR, THOUSEP, nl_langinfo,
|
||||
localeconv, Error)
|
||||
import unittest
|
||||
from platform import uname
|
||||
|
@ -28,10 +28,10 @@
|
|||
class _LocaleTests(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.oldlocale = setlocale(LC_NUMERIC)
|
||||
self.oldlocale = setlocale(LC_ALL)
|
||||
|
||||
def tearDown(self):
|
||||
setlocale(LC_NUMERIC, self.oldlocale)
|
||||
setlocale(LC_ALL, self.oldlocale)
|
||||
|
||||
# Want to know what value was calculated, what it was compared against,
|
||||
# what function was used for the calculation, what type of data was used,
|
||||
|
@ -58,6 +58,7 @@ def test_lc_numeric_nl_langinfo(self):
|
|||
for loc in candidate_locales:
|
||||
try:
|
||||
setlocale(LC_NUMERIC, loc)
|
||||
setlocale(LC_CTYPE, loc)
|
||||
except Error:
|
||||
continue
|
||||
for li, lc in ((RADIXCHAR, "decimal_point"),
|
||||
|
@ -69,6 +70,7 @@ def test_lc_numeric_localeconv(self):
|
|||
for loc in candidate_locales:
|
||||
try:
|
||||
setlocale(LC_NUMERIC, loc)
|
||||
setlocale(LC_CTYPE, loc)
|
||||
except Error:
|
||||
continue
|
||||
for li, lc in ((RADIXCHAR, "decimal_point"),
|
||||
|
@ -80,6 +82,7 @@ def test_lc_numeric_basic(self):
|
|||
for loc in candidate_locales:
|
||||
try:
|
||||
setlocale(LC_NUMERIC, loc)
|
||||
setlocale(LC_CTYPE, loc)
|
||||
except Error:
|
||||
continue
|
||||
for li, lc in ((RADIXCHAR, "decimal_point"),
|
||||
|
@ -102,6 +105,7 @@ def test_float_parsing(self):
|
|||
for loc in candidate_locales:
|
||||
try:
|
||||
setlocale(LC_NUMERIC, loc)
|
||||
setlocale(LC_CTYPE, loc)
|
||||
except Error:
|
||||
continue
|
||||
|
||||
|
|
Loading…
Reference in New Issue