mirror of https://github.com/python/cpython
bpo-41113: Fix test_warnings on non-Western locales. (GH-21143)
This commit is contained in:
parent
aad8f0eeca
commit
0f8ec1fff0
|
@ -1198,13 +1198,13 @@ class EnvironmentVariableTests(BaseTest):
|
||||||
@unittest.skipUnless(sys.getfilesystemencoding() != 'ascii',
|
@unittest.skipUnless(sys.getfilesystemencoding() != 'ascii',
|
||||||
'requires non-ascii filesystemencoding')
|
'requires non-ascii filesystemencoding')
|
||||||
def test_nonascii(self):
|
def test_nonascii(self):
|
||||||
|
PYTHONWARNINGS="ignore:DeprecationWarning" + (support.FS_NONASCII or '')
|
||||||
rc, stdout, stderr = assert_python_ok("-c",
|
rc, stdout, stderr = assert_python_ok("-c",
|
||||||
"import sys; sys.stdout.write(str(sys.warnoptions))",
|
"import sys; sys.stdout.write(str(sys.warnoptions))",
|
||||||
PYTHONIOENCODING="utf-8",
|
PYTHONIOENCODING="utf-8",
|
||||||
PYTHONWARNINGS="ignore:DeprecaciónWarning",
|
PYTHONWARNINGS=PYTHONWARNINGS,
|
||||||
PYTHONDEVMODE="")
|
PYTHONDEVMODE="")
|
||||||
self.assertEqual(stdout,
|
self.assertEqual(stdout, str([PYTHONWARNINGS]).encode())
|
||||||
"['ignore:DeprecaciónWarning']".encode('utf-8'))
|
|
||||||
|
|
||||||
class CEnvironmentVariableTests(EnvironmentVariableTests, unittest.TestCase):
|
class CEnvironmentVariableTests(EnvironmentVariableTests, unittest.TestCase):
|
||||||
module = c_warnings
|
module = c_warnings
|
||||||
|
|
Loading…
Reference in New Issue