Test that an unexpected EOF SyntaxError is nicely presented.
(self)
| 1977 | ), "Incorrect config loaded." |
| 1978 | |
| 1979 | def test_for_handled_unexpected_eof_error(self) -> None: |
| 1980 | """ |
| 1981 | Test that an unexpected EOF SyntaxError is nicely presented. |
| 1982 | """ |
| 1983 | with pytest.raises(black.parsing.InvalidInput) as exc_info: |
| 1984 | black.lib2to3_parse("print(", {}) |
| 1985 | |
| 1986 | exc_info.match( |
| 1987 | re.escape( |
| 1988 | "Cannot parse: 1:6\n" |
| 1989 | " print(\n" |
| 1990 | " ^\n" |
| 1991 | "TokenError: Unexpected EOF in multi-line statement" |
| 1992 | ) |
| 1993 | ) |
| 1994 | |
| 1995 | def test_line_ranges_with_code_option(self) -> None: |
| 1996 | code = textwrap.dedent("""\ |