X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/a18ee4018f855007bf4a23027a8d6478e56a36bf..28ab82aab013978b7ed91bda816de3d41385f260:/tests/test_black.py?ds=sidebyside 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: