]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41113: Fix test_warnings on non-Western locales. (GH-21143)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 25 Jun 2020 12:04:56 +0000 (05:04 -0700)
committerGitHub <noreply@github.com>
Thu, 25 Jun 2020 12:04:56 +0000 (05:04 -0700)
(cherry picked from commit 0f8ec1fff01173803645ad6a8aea24997bf66fc1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/test/test_warnings/__init__.py

index 985adc1cda781c7d6219c345bba3a053b67e8b38..7b0d06b3201970fea42b2c62572dbce2a386e1ea 100644 (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