Commit 073f759d authored by Victor Stinner's avatar Victor Stinner

Move non-ascii test from test_run_code() to a new function: test_non_ascii()

parent f6211eda
...@@ -99,14 +99,16 @@ class CmdLineTest(unittest.TestCase): ...@@ -99,14 +99,16 @@ class CmdLineTest(unittest.TestCase):
# All good if execution is successful # All good if execution is successful
assert_python_ok('-c', 'pass') 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 # Test handling of non-ascii data
if sys.getfilesystemencoding() != 'ascii': if test.support.verbose:
if test.support.verbose: import locale
import locale print('locale encoding = %s, filesystem encoding = %s'
print('locale encoding = %s, filesystem encoding = %s' % (locale.getpreferredencoding(), sys.getfilesystemencoding()))
% (locale.getpreferredencoding(), sys.getfilesystemencoding())) command = "assert(ord('\xe9') == 0xe9)"
command = "assert(ord('\xe9') == 0xe9)" assert_python_ok('-c', command)
assert_python_ok('-c', command)
# On Windows, pass bytes to subprocess doesn't test how Python decodes the # On Windows, pass bytes to subprocess doesn't test how Python decodes the
# command line, but how subprocess does decode bytes to unicode. Python # command line, but how subprocess does decode bytes to unicode. Python
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment