@@ -615,6 +615,22 @@ def test_syntaxerror_multi_line_fstring(self):
|
615 | 615 | ], |
616 | 616 | ) |
617 | 617 | |
| 618 | +def test_syntaxerror_invalid_escape_sequence_multi_line(self): |
| 619 | +script = 'foo = """\\q\n"""\n' |
| 620 | +with support.temp_dir() as script_dir: |
| 621 | +script_name = _make_test_script(script_dir, 'script', script) |
| 622 | +exitcode, stdout, stderr = assert_python_failure( |
| 623 | +'-Werror', script_name, |
| 624 | + ) |
| 625 | +self.assertEqual( |
| 626 | +stderr.splitlines()[-3:], |
| 627 | + [ |
| 628 | +b' foo = """\\q', |
| 629 | +b' ^', |
| 630 | +b'SyntaxError: invalid escape sequence \\q', |
| 631 | + ], |
| 632 | + ) |
| 633 | + |
618 | 634 | def test_consistent_sys_path_for_direct_execution(self): |
619 | 635 | # This test case ensures that the following all give the same |
620 | 636 | # sys.path configuration: |
|