[Python-checkins] bpo-41113: Fix test_warnings on non-Western locales. (GH-21143)
Serhiy Storchaka
webhook-mailer at python.org
Thu Jun 25 07:43:38 EDT 2020
https://github.com/python/cpython/commit/0f8ec1fff01173803645ad6a8aea24997bf66fc1
commit: 0f8ec1fff01173803645ad6a8aea24997bf66fc1
branch: master
author: Serhiy Storchaka <storchaka at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-06-25T14:43:33+03:00
summary:
bpo-41113: Fix test_warnings on non-Western locales. (GH-21143)
files:
M Lib/test/test_warnings/__init__.py
diff --git a/Lib/test/test_warnings/__init__.py b/Lib/test/test_warnings/__init__.py
index 268ecb03f4dc6..65d0b557104bd 100644
--- a/Lib/test/test_warnings/__init__.py
+++ b/Lib/test/test_warnings/__init__.py
@@ -1198,13 +1198,13 @@ def test_default_filter_configuration(self):
@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
More information about the Python-checkins
mailing list