diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2012-11-06 22:23:43 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2012-11-06 22:23:43 (GMT) |
commit | 8b219b2936d767bf6c6c17618db3a7b22fc2e865 (patch) | |
tree | 717f4aa9f9aa97ffb916269572869b55018c831c /Lib/test/test_cmd_line_script.py | |
parent | df1d940c7c59398717a1b63d8681f26aeae48b87 (diff) | |
download | cpython-8b219b2936d767bf6c6c17618db3a7b22fc2e865.zip cpython-8b219b2936d767bf6c6c17618db3a7b22fc2e865.tar.gz cpython-8b219b2936d767bf6c6c17618db3a7b22fc2e865.tar.bz2 |
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_script.py')
-rw-r--r-- | Lib/test/test_cmd_line_script.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py index a8472c0..2d3a8f3 100644 --- a/Lib/test/test_cmd_line_script.py +++ b/Lib/test/test_cmd_line_script.py @@ -363,19 +363,12 @@ class CmdLineTest(unittest.TestCase): self.assertTrue(text[1].startswith(' File ')) self.assertTrue(text[3].startswith('NameError')) + @unittest.skipUnless(support.TESTFN_NONASCII, 'need support.TESTFN_NONASCII') def test_non_ascii(self): # Issue #16218 # non-ascii filename encodable to cp1252, cp932, latin1 and utf8 - filename = support.TESTFN + '\xa3' - try: - os.fsencode(filename) - except UnicodeEncodeError: - self.skipTest( - "Filesystem encoding %r cannot encode " - "the filename: %a" - % (sys.getfilesystemencoding(), filename)) source = 'print(ascii(__file__))\n' - script_name = _make_test_script(os.curdir, filename, source) + script_name = _make_test_script(os.curdir, support.TESTFN_NONASCII, source) self.addCleanup(support.unlink, script_name) rc, stdout, stderr = assert_python_ok(script_name) self.assertEqual( |