File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -589,6 +589,7 @@ def test_format_specifier_expressions(self):
589
589
self .assertEqual (f'{ - 10 :-{"#" }1{0 }x} ' , ' -0xa' )
590
590
self .assertEqual (f'{ - 10 :{"-" }#{1 }0{"x" }} ' , ' -0xa' )
591
591
self .assertEqual (f'{ 10 :#{3 != {4 :5 } and width }x} ' , ' 0xa' )
592
+ self .assertEqual (f'result: { value :{width :{0 }}.{precision :1}} ' , 'result: 12.35' )
592
593
593
594
self .assertAllRaise (SyntaxError , "f-string: expecting '}'" ,
594
595
["""f'{"s"!r{":10"}}'""" ,
@@ -601,11 +602,6 @@ def test_format_specifier_expressions(self):
601
602
"f'{4:{/5}}'" ,
602
603
])
603
604
604
- self .assertAllRaise (SyntaxError , "f-string: expressions nested too deeply" ,
605
- [# Can't nest format specifiers.
606
- "f'result: {value:{width:{0}}.{precision:1}}'" ,
607
- ])
608
-
609
605
self .assertAllRaise (SyntaxError , 'f-string: invalid conversion character' ,
610
606
[# No expansion inside conversion or for
611
607
# the : or ! itself.
You can’t perform that action at this time.
0 commit comments