Issue #16218, #16414, #16444: Backport FS_NONASCII, TESTFN_UNDECODABLE,

TESTFN_NONASCII of test.support from Python 3.4. Backport tests on non-ASCII
paths.
This commit is contained in:
Victor Stinner 2013-01-03 01:50:30 +01:00
parent 20b654acb5
commit 0af71aae2d
5 changed files with 122 additions and 7 deletions

View file

@ -100,11 +100,11 @@ 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
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