mirror of
https://github.com/python/cpython.git
synced 2025-09-09 18:32:22 +00:00
Issue #16218: Fix broken test for supporting nonascii characters in python launcher
This commit is contained in:
parent
47395617bc
commit
683b46aa8d
1 changed files with 12 additions and 5 deletions
|
@ -366,11 +366,18 @@ class CmdLineTest(unittest.TestCase):
|
||||||
def test_non_utf8(self):
|
def test_non_utf8(self):
|
||||||
# Issue #16218
|
# Issue #16218
|
||||||
with temp_dir() as script_dir:
|
with temp_dir() as script_dir:
|
||||||
script_name = _make_test_script(script_dir,
|
script_basename = '\udcf1\udcea\udcf0\udce8\udcef\udcf2'
|
||||||
'\udcf1\udcea\udcf0\udce8\udcef\udcf2')
|
source = 'print("test output")\n'
|
||||||
self._check_script(script_name, script_name, script_name,
|
script_name = _make_test_script(script_dir, script_basename, source)
|
||||||
script_dir, None,
|
if not __debug__:
|
||||||
importlib.machinery.SourceFileLoader)
|
run_args = ('-' + 'O' * sys.flags.optimize, script_name)
|
||||||
|
else:
|
||||||
|
run_args = (script_name,)
|
||||||
|
rc, out, _ = assert_python_ok(*run_args)
|
||||||
|
self.assertEqual(0, rc)
|
||||||
|
expected = ("test output" + os.linesep).encode('ascii')
|
||||||
|
self.assertEqual(expected, out)
|
||||||
|
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
support.run_unittest(CmdLineTest)
|
support.run_unittest(CmdLineTest)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue