X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/136930fccb99320865622e12ffc21bdd45fd7501..f52cb0fe3775829245acfeae191e8d63120c8416:/tests/test_black.py?ds=inline diff --git a/tests/test_black.py b/tests/test_black.py index 51a2030..9259853 100644 --- a/tests/test_black.py +++ b/tests/test_black.py @@ -1557,6 +1557,15 @@ class BlackTestCase(BlackBaseTestCase): call_args[0].lower() == str(pyproject_path).lower() ), "Incorrect config loaded." + def test_for_handled_unexpected_eof_error(self) -> None: + """ + Test that an unexpected EOF SyntaxError is nicely presented. + """ + with pytest.raises(black.parsing.InvalidInput) as exc_info: + black.lib2to3_parse("print(", {}) + + exc_info.match("Cannot parse: 2:0: EOF in multi-line statement") + class TestCaching: def test_cache_broken_file(self) -> None: