Skip to content

Commit 84fbba0

Browse files
committed
Add test for parenthesized walrus target
1 parent bb95d1f commit 84fbba0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Lib/test/test_syntax.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2852,6 +2852,11 @@ def test_assign_del(self):
28522852
# report "cannot delete name"
28532853
self._check_error("del a += b", "invalid syntax")
28542854

2855+
def test_parenthesized_named_expression_target(self):
2856+
self._check_error(
2857+
"((a) := 1)",
2858+
"cannot parenthesize target name in assignment expression")
2859+
28552860
def test_global_param_err_first(self):
28562861
source = """if 1:
28572862
def error(a):

0 commit comments

Comments
 (0)