X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/3083f4470bba6838d0ad59e9748f45a7621623b5..3501cefb09eb8448bd82287840c9093f10c25299:/tests/test_black.py?ds=sidebyside diff --git a/tests/test_black.py b/tests/test_black.py index 468f00f..63cd716 100644 --- a/tests/test_black.py +++ b/tests/test_black.py @@ -1584,6 +1584,16 @@ class BlackTestCase(BlackBaseTestCase): exc_info.match("Cannot parse: 2:0: EOF in multi-line statement") + def test_equivalency_ast_parse_failure_includes_error(self) -> None: + with pytest.raises(AssertionError) as err: + black.assert_equivalent("a«»a = 1", "a«»a = 1") + + err.match("--safe") + # Unfortunately the SyntaxError message has changed in newer versions so we + # can't match it directly. + err.match("invalid character") + err.match(r"\(, line 1\)") + class TestCaching: def test_cache_broken_file(self) -> None: