summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorShantanu <hauntsaninja@users.noreply.github.com>2020-06-06 10:08:48 (GMT)
committerGitHub <noreply@github.com>2020-06-06 10:08:48 (GMT)
commitf7ed4d4e83f5d9e85e244a1cbc460f26436ab24d (patch)
treede469bc0aa35508ca96bfaa8dd5e4cda290d925f /Lib/test
parentc067183605cf84bb1a246635f52827251d0476f8 (diff)
downloadcpython-f7ed4d4e83f5d9e85e244a1cbc460f26436ab24d.zip
cpython-f7ed4d4e83f5d9e85e244a1cbc460f26436ab24d.tar.gz
cpython-f7ed4d4e83f5d9e85e244a1cbc460f26436ab24d.tar.bz2
bpo-40614: Respect feature version for f-string debug expressions (GH-20196) (GH-20466)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com> (cherry picked from commit c116c94ff119485761460f1033cdee425bed0310)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_ast.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py
index 486f2aa..8693466 100644
--- a/Lib/test/test_ast.py
+++ b/Lib/test/test_ast.py
@@ -630,6 +630,12 @@ class AST_Tests(unittest.TestCase):
attr_b = tree.body[0].decorator_list[0].value
self.assertEqual(attr_b.end_col_offset, 4)
+ def test_issue40614_feature_version(self):
+ ast.parse('f"{x=}"', feature_version=(3, 8))
+ with self.assertRaises(SyntaxError):
+ ast.parse('f"{x=}"', feature_version=(3, 7))
+
+
class ASTHelpers_Test(unittest.TestCase):
maxDiff = None