@@ -627,6 +627,22 @@ def test_syntaxerror_multi_line_fstring(self):
|
627 | 627 | ], |
628 | 628 | ) |
629 | 629 | |
| 630 | +def test_syntaxerror_invalid_escape_sequence_multi_line(self): |
| 631 | +script = 'foo = """\\q\n"""\n' |
| 632 | +with support.temp_dir() as script_dir: |
| 633 | +script_name = _make_test_script(script_dir, 'script', script) |
| 634 | +exitcode, stdout, stderr = assert_python_failure( |
| 635 | +'-Werror', script_name, |
| 636 | + ) |
| 637 | +self.assertEqual( |
| 638 | +stderr.splitlines()[-3:], |
| 639 | + [ |
| 640 | +b' foo = """\\q', |
| 641 | +b' ^', |
| 642 | +b'SyntaxError: invalid escape sequence \\q', |
| 643 | + ], |
| 644 | + ) |
| 645 | + |
630 | 646 | def test_consistent_sys_path_for_direct_execution(self): |
631 | 647 | # This test case ensures that the following all give the same |
632 | 648 | # sys.path configuration: |
|