summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-10-20 21:56:55 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-10-20 21:56:55 (GMT)
commit073f759d65118674c4c7b82f778dde44ae22c6c9 (patch)
treefc21310f22c12671795cd319664781d0b93c7499
parentf6211eda71085609f0c126e1c9422f10f9637170 (diff)
downloadcpython-073f759d65118674c4c7b82f778dde44ae22c6c9.zip
cpython-073f759d65118674c4c7b82f778dde44ae22c6c9.tar.gz
cpython-073f759d65118674c4c7b82f778dde44ae22c6c9.tar.bz2
Move non-ascii test from test_run_code() to a new function: test_non_ascii()
-rw-r--r--Lib/test/test_cmd_line.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py
index 35de813..73acb9f 100644
--- a/Lib/test/test_cmd_line.py
+++ b/Lib/test/test_cmd_line.py
@@ -99,14 +99,16 @@ 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')
+ def test_non_ascii(self):
# Test handling of non-ascii data
- if sys.getfilesystemencoding() != 'ascii':
- if test.support.verbose:
- import locale
- print('locale encoding = %s, filesystem encoding = %s'
- % (locale.getpreferredencoding(), sys.getfilesystemencoding()))
- command = "assert(ord('\xe9') == 0xe9)"
- assert_python_ok('-c', command)
+ if test.support.verbose:
+ import locale
+ print('locale encoding = %s, filesystem encoding = %s'
+ % (locale.getpreferredencoding(), sys.getfilesystemencoding()))
+ command = "assert(ord('\xe9') == 0xe9)"
+ assert_python_ok('-c', command)
# On Windows, pass bytes to subprocess doesn't test how Python decodes the
# command line, but how subprocess does decode bytes to unicode. Python