diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2021-11-24 22:21:23 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-24 22:21:23 (GMT) |
commit | 24c10d2943c482c4d3ecc71d45df2d8c10fa5bb1 (patch) | |
tree | bcd92d5aa5eb38532813cd703dc7f728d20d230a /Lib | |
parent | f4afc53bf68c8ded20b281cd1baa88a679b4a3fd (diff) | |
download | cpython-24c10d2943c482c4d3ecc71d45df2d8c10fa5bb1.zip cpython-24c10d2943c482c4d3ecc71d45df2d8c10fa5bb1.tar.gz cpython-24c10d2943c482c4d3ecc71d45df2d8c10fa5bb1.tar.bz2 |
bpo-45727: Only trigger the 'did you forgot a comma' error suggestion if inside parentheses (GH-29757)
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_exceptions.py | 4 | ||||
-rw-r--r-- | Lib/test/test_fstring.py | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py index eee178c..7f087d0 100644 --- a/Lib/test/test_exceptions.py +++ b/Lib/test/test_exceptions.py @@ -226,14 +226,14 @@ class ExceptionTests(unittest.TestCase): check(b'Python = "\xcf\xb3\xf2\xee\xed" +', 1, 18) check('x = "a', 1, 5) check('lambda x: x = 2', 1, 1) - check('f{a + b + c}', 1, 1) + check('f{a + b + c}', 1, 2) check('[file for str(file) in []\n])', 1, 11) check('a = « hello » « world »', 1, 5) check('[\nfile\nfor str(file)\nin\n[]\n]', 3, 5) check('[file for\n str(file) in []]', 2, 2) check("ages = {'Alice'=22, 'Bob'=23}", 1, 16) check('match ...:\n case {**rest, "key": value}:\n ...', 2, 19) - check("a b c d e f", 1, 1) + check("[a b c d e f]", 1, 2) # Errors thrown by compile.c check('class foo:return 1', 1, 11) diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index 14a4c67..bd1ca94 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -944,7 +944,7 @@ x = ( "Bf''", "BF''",] double_quote_cases = [case.replace("'", '"') for case in single_quote_cases] - self.assertAllRaise(SyntaxError, 'unexpected EOF while parsing', + self.assertAllRaise(SyntaxError, 'invalid syntax', single_quote_cases + double_quote_cases) def test_leading_trailing_spaces(self): |