summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_fstring.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-12-17 15:34:14 (GMT)
committerGitHub <noreply@github.com>2018-12-17 15:34:14 (GMT)
commit94cf308ee231bfbfaa9ddc50b9764545a1318773 (patch)
treeadc068a6567b6712226436ad399951ad888cb53c /Lib/test/test_fstring.py
parentbdabb0737c631835b246c9823852d20331243315 (diff)
downloadcpython-94cf308ee231bfbfaa9ddc50b9764545a1318773.zip
cpython-94cf308ee231bfbfaa9ddc50b9764545a1318773.tar.gz
cpython-94cf308ee231bfbfaa9ddc50b9764545a1318773.tar.bz2
bpo-33306: Improve SyntaxError messages for unbalanced parentheses. (GH-6516)
Diffstat (limited to 'Lib/test/test_fstring.py')
-rw-r--r--Lib/test/test_fstring.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py
index 09b5ae1..fe3804b 100644
--- a/Lib/test/test_fstring.py
+++ b/Lib/test/test_fstring.py
@@ -1004,10 +1004,14 @@ non-important content
self.assertEqual('{d[0]}'.format(d=d), 'integer')
def test_invalid_expressions(self):
- self.assertAllRaise(SyntaxError, 'invalid syntax',
- [r"f'{a[4)}'",
- r"f'{a(4]}'",
- ])
+ self.assertAllRaise(SyntaxError,
+ r"closing parenthesis '\)' does not match "
+ r"opening parenthesis '\[' \(<fstring>, line 1\)",
+ [r"f'{a[4)}'"])
+ self.assertAllRaise(SyntaxError,
+ r"closing parenthesis '\]' does not match "
+ r"opening parenthesis '\(' \(<fstring>, line 1\)",
+ [r"f'{a(4]}'"])
def test_errors(self):
# see issue 26287