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
|
self._pos += 1
|
||||||
|
|
||||||
if ch1 is None:
|
if ch1 is None:
|
||||||
raise StringFormattingException(
|
break # will hit closing bracket error
|
||||||
"Open bracket at the end was not properly closed"
|
|
||||||
)
|
|
||||||
|
|
||||||
if ch1 == "%":
|
if ch1 == "%":
|
||||||
self._pos += 1
|
self._pos += 1
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ class TestParser:
|
||||||
|
|
||||||
class TestParserBracketFailures:
|
class TestParserBracketFailures:
|
||||||
def test_bracket_open(self):
|
def test_bracket_open(self):
|
||||||
with pytest.raises(StringFormattingException):
|
with pytest.raises(InvalidSyntaxException, match=re.escape(str(BRACKET_NOT_CLOSED))):
|
||||||
parse("{")
|
parse("{")
|
||||||
|
|
||||||
def test_bracket_close(self):
|
def test_bracket_close(self):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue