bpo-41113: Fix test_warnings on non-Western locales. (GH-21143)

(cherry picked from commit 0f8ec1fff0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2020-06-25 05:04:56 -07:00 committed by GitHub
parent 7318f0ab23
commit f547d06ea7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -1199,13 +1199,13 @@ class EnvironmentVariableTests(BaseTest):
@unittest.skipUnless(sys.getfilesystemencoding() != 'ascii',
'requires non-ascii filesystemencoding')
def test_nonascii(self):
PYTHONWARNINGS="ignore:DeprecationWarning" + (support.FS_NONASCII or '')
rc, stdout, stderr = assert_python_ok("-c",
"import sys; sys.stdout.write(str(sys.warnoptions))",
PYTHONIOENCODING="utf-8",
PYTHONWARNINGS="ignore:DeprecaciónWarning",
PYTHONWARNINGS=PYTHONWARNINGS,
PYTHONDEVMODE="")
self.assertEqual(stdout,
"['ignore:DeprecaciónWarning']".encode('utf-8'))
self.assertEqual(stdout, str([PYTHONWARNINGS]).encode())
class CEnvironmentVariableTests(EnvironmentVariableTests, unittest.TestCase):
module = c_warnings