better error
This commit is contained in:
parent
f74d43a67c
commit
1ccee475c3
2 changed files with 2 additions and 4 deletions
|
|
@ -467,9 +467,7 @@ class _Parser:
|
|||
self._pos += 1
|
||||
|
||||
if ch1 is None:
|
||||
raise StringFormattingException(
|
||||
"Open bracket at the end was not properly closed"
|
||||
)
|
||||
break # will hit closing bracket error
|
||||
|
||||
if ch1 == "%":
|
||||
self._pos += 1
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ class TestParser:
|
|||
|
||||
class TestParserBracketFailures:
|
||||
def test_bracket_open(self):
|
||||
with pytest.raises(StringFormattingException):
|
||||
with pytest.raises(InvalidSyntaxException, match=re.escape(str(BRACKET_NOT_CLOSED))):
|
||||
parse("{")
|
||||
|
||||
def test_bracket_close(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue