summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmd_line.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2012-11-12 00:23:15 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2012-11-12 00:23:15 (GMT)
commite667e98faad93e76b8b569d853eb02d91591f5fb (patch)
tree009075f72468af1156312858aada27dd389678f3 /Lib/test/test_cmd_line.py
parent37bfa4e7ec5df1528aa208150933a3fc54508cf9 (diff)
downloadcpython-e667e98faad93e76b8b569d853eb02d91591f5fb.zip
cpython-e667e98faad93e76b8b569d853eb02d91591f5fb.tar.gz
cpython-e667e98faad93e76b8b569d853eb02d91591f5fb.tar.bz2
Issue #16218, #16444: Backport improvment on tests for non-ASCII characters
Diffstat (limited to 'Lib/test/test_cmd_line.py')
-rw-r--r--Lib/test/test_cmd_line.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index 2b0c6e2..f617c2f 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -93,15 +93,15 @@ class CmdLineTest(unittest.TestCase):
# All good if execution is successful
assert_python_ok('-c', 'pass')
- @unittest.skipIf(sys.getfilesystemencoding() == 'ascii',
- 'need a filesystem encoding different than ASCII')
+ @unittest.skipUnless(test.support.FS_NONASCII, 'need support.FS_NONASCII')
def test_non_ascii(self):
# Test handling of non-ascii data
if test.support.verbose:
import locale
print('locale encoding = %s, filesystem encoding = %s'
% (locale.getpreferredencoding(), sys.getfilesystemencoding()))
- command = "assert(ord('\xe9') == 0xe9)"
+ command = ("assert(ord(%r) == %s)"
+ % (test.support.FS_NONASCII, ord(test.support.FS_NONASCII)))
assert_python_ok('-c', command)
# On Windows, pass bytes to subprocess doesn't test how Python decodes the