From 835f14ff8eec10b3d96f821a1eb46a986e00c690 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Sun, 31 Jan 2021 22:52:56 +0000 Subject: bpo-43017: Improve error message for unparenthesised tuples in comprehensions (GH24314) --- Lib/test/test_named_expressions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Lib/test/test_named_expressions.py') diff --git a/Lib/test/test_named_expressions.py b/Lib/test/test_named_expressions.py index 5908f121085..20ac2e699f0 100644 --- a/Lib/test/test_named_expressions.py +++ b/Lib/test/test_named_expressions.py @@ -101,7 +101,8 @@ class NamedExpressionInvalidTest(unittest.TestCase): def test_named_expression_invalid_17(self): code = "[i := 0, j := 1 for i, j in [(1, 2), (3, 4)]]" - with self.assertRaisesRegex(SyntaxError, "invalid syntax"): + with self.assertRaisesRegex(SyntaxError, + "did you forget parentheses around the comprehension target?"): exec(code, {}, {}) def test_named_expression_invalid_in_class_body(self): -- cgit v1.2.3