Commit 44212ec8 authored by Anthony Sottile's avatar Anthony Sottile Committed by Pablo Galindo

Add additional test for multi-line SyntaxError (GH-15003)

parent 5b94f357
......@@ -627,6 +627,22 @@ class CmdLineTest(unittest.TestCase):
],
)
def test_syntaxerror_invalid_escape_sequence_multi_line(self):
script = 'foo = """\\q\n"""\n'
with support.temp_dir() as script_dir:
script_name = _make_test_script(script_dir, 'script', script)
exitcode, stdout, stderr = assert_python_failure(
'-Werror', script_name,
)
self.assertEqual(
stderr.splitlines()[-3:],
[
b' foo = """\\q',
b' ^',
b'SyntaxError: invalid escape sequence \\q',
],
)
def test_consistent_sys_path_for_direct_execution(self):
# This test case ensures that the following all give the same
# sys.path configuration:
......
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