diff options
author | Philip Jenvey <pjenvey@underboss.org> | 2010-04-14 03:01:39 (GMT) |
---|---|---|
committer | Philip Jenvey <pjenvey@underboss.org> | 2010-04-14 03:01:39 (GMT) |
commit | e53de3dc4a9021b5edabd44fd495df7770b6249c (patch) | |
tree | 6ce047d569cd2973b4fa2292e4f1620f0e2befe5 /Lib | |
parent | 9b82f990cb57035daa6de4c0df9911ba8461a963 (diff) | |
download | cpython-e53de3dc4a9021b5edabd44fd495df7770b6249c.zip cpython-e53de3dc4a9021b5edabd44fd495df7770b6249c.tar.gz cpython-e53de3dc4a9021b5edabd44fd495df7770b6249c.tar.bz2 |
#7301: decode $PYTHONWARNINGS in the same way as argv, test non-ascii values
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_warnings.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_warnings.py b/Lib/test/test_warnings.py index ca733f7..5f6a670 100644 --- a/Lib/test/test_warnings.py +++ b/Lib/test/test_warnings.py @@ -718,6 +718,19 @@ class EnvironmentVariableTests(BaseTest): b"['ignore::UnicodeWarning', 'ignore::DeprecationWarning']") self.assertEqual(p.wait(), 0) + @unittest.skipUnless(sys.getfilesystemencoding() != 'ascii', + 'requires non-ascii filesystemencoding') + def test_nonascii(self): + newenv = os.environ.copy() + newenv["PYTHONWARNINGS"] = "ignore:DeprecaciónWarning" + newenv["PYTHONIOENCODING"] = "utf-8" + p = subprocess.Popen([sys.executable, + "-c", "import sys; sys.stdout.write(str(sys.warnoptions))"], + stdout=subprocess.PIPE, env=newenv) + self.assertEqual(p.communicate()[0], + "['ignore:DeprecaciónWarning']".encode('utf-8')) + self.assertEqual(p.wait(), 0) + class CEnvironmentVariableTests(EnvironmentVariableTests): module = c_warnings |