@@ -511,6 +511,11 @@ def test_mismatched_parens(self):
511511 ])
512512 self .assertRaises (SyntaxError , eval , "f'{" + "(" * 500 + "}'" )
513513
514+ def test_fstring_nested_too_deeply (self ):
515+ self .assertAllRaise (SyntaxError ,
516+ "f-string: expressions nested too deeply" ,
517+ ['f"{1+2:{1+2:{1+1:{1}}}}"' ])
518+
514519 def test_double_braces (self ):
515520 self .assertEqual (f'{{' , '{' )
516521 self .assertEqual (f'a{{' , 'a{' )
@@ -741,6 +746,7 @@ def test_parens_in_expressions(self):
741746 self .assertAllRaise (SyntaxError , 'unterminated string literal' ,
742747 ["f'{\n }'" ,
743748 ])
749+
744750 def test_newlines_before_syntax_error (self ):
745751 self .assertAllRaise (SyntaxError , "invalid syntax" ,
746752 ["f'{.}'" , "\n f'{.}'" , "\n \n f'{.}'" ])
@@ -1390,7 +1396,6 @@ def __repr__(self):
13901396 #self.assertEqual(f'X{x =}Y', 'Xx\t='+repr(x)+'Y')
13911397 #self.assertEqual(f'X{x = }Y', 'Xx\t=\t'+repr(x)+'Y')
13921398
1393-
13941399 def test_walrus (self ):
13951400 x = 20
13961401 # This isn't an assignment expression, it's 'x', with a format
0 commit comments