summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ast.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_ast.py')
-rw-r--r--Lib/test/test_ast.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 2258924..5d7e441 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -743,6 +743,11 @@ class AST_Tests(unittest.TestCase):
with self.assertRaises(SyntaxError):
ast.parse('f"{x=}"', feature_version=(3, 7))
+ def test_assignment_expression_feature_version(self):
+ ast.parse('(x := 0)', feature_version=(3, 8))
+ with self.assertRaises(SyntaxError):
+ ast.parse('(x := 0)', feature_version=(3, 7))
+
def test_constant_as_name(self):
for constant in "True", "False", "None":
expr = ast.Expression(ast.Name(constant, ast.Load()))