diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2020-06-25 11:43:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-25 11:43:33 (GMT) |
commit | 0f8ec1fff01173803645ad6a8aea24997bf66fc1 (patch) | |
tree | 6ee668032fd933ec5d8163cd36bd52d3ece6323e | |
parent | aad8f0eeca93b2150760b5e59ed0495e47d1be1e (diff) | |
download | cpython-0f8ec1fff01173803645ad6a8aea24997bf66fc1.zip cpython-0f8ec1fff01173803645ad6a8aea24997bf66fc1.tar.gz cpython-0f8ec1fff01173803645ad6a8aea24997bf66fc1.tar.bz2 |
bpo-41113: Fix test_warnings on non-Western locales. (GH-21143)
-rw-r--r-- | Lib/test/test_warnings/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_warnings/__init__.py b/Lib/test/test_warnings/__init__.py index 268ecb0..65d0b55 100644 --- a/Lib/test/test_warnings/__init__.py +++ b/Lib/test/test_warnings/__init__.py @@ -1198,13 +1198,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 |