From e925175040f0f55b6fadf7cd03bd77fb17650b39 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 7 Mar 2019 12:13:15 -0800 Subject: Add test for underscore in number --- Lib/test/test_type_comments.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Lib/test/test_type_comments.py b/Lib/test/test_type_comments.py index 7f71ee851d..cac6e8b25d 100644 --- a/Lib/test/test_type_comments.py +++ b/Lib/test/test_type_comments.py @@ -40,6 +40,10 @@ a = 42 f"{a}" """ +underscorednumber = """\ +a = 42_42_42 +""" + redundantdef = """\ def foo(): # type: () -> int # type: () -> str @@ -229,6 +233,10 @@ class TypeCommentTests(unittest.TestCase): for tree in self.parse_all(fstring, minver=6): pass + def test_underscorednumber(self): + for tree in self.parse_all(underscorednumber, minver=6): + pass + def test_redundantdef(self): for tree in self.parse_all(redundantdef, maxver=0, expected_regex="^Cannot have two type comments on def"): -- cgit v1.2.1