diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2012-11-06 23:23:43 +0100 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2012-11-06 23:23:43 +0100 |
| commit | 8b219b2936d767bf6c6c17618db3a7b22fc2e865 (patch) | |
| tree | 717f4aa9f9aa97ffb916269572869b55018c831c /Lib/test/test_cmd_line.py | |
| parent | df1d940c7c59398717a1b63d8681f26aeae48b87 (diff) | |
| download | cpython-git-8b219b2936d767bf6c6c17618db3a7b22fc2e865.tar.gz | |
Issue #16414: Add support.FS_NONASCII and support.TESTFN_NONASCII
These constants are used to test functions with non-ASCII data, especially
filenames.
Diffstat (limited to 'Lib/test/test_cmd_line.py')
| -rw-r--r-- | Lib/test/test_cmd_line.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_cmd_line.py b/Lib/test/test_cmd_line.py index 4b39115de8..bd8a767110 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 |
