Skip to content

Commit 4813207

Browse files
committed
1 parent 81ed1ec commit 4813207

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Lib/test/test_fstring.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ def test_format_specifier_expressions(self):
589589
self.assertEqual(f'{-10:-{"#"}1{0}x}', ' -0xa')
590590
self.assertEqual(f'{-10:{"-"}#{1}0{"x"}}', ' -0xa')
591591
self.assertEqual(f'{10:#{3 != {4:5} and width}x}', ' 0xa')
592+
self.assertEqual(f'result: {value:{width:{0}}.{precision:1}}', 'result: 12.35')
592593

593594
self.assertAllRaise(SyntaxError, "f-string: expecting '}'",
594595
["""f'{"s"!r{":10"}}'""",
@@ -601,11 +602,6 @@ def test_format_specifier_expressions(self):
601602
"f'{4:{/5}}'",
602603
])
603604

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-
609605
self.assertAllRaise(SyntaxError, 'f-string: invalid conversion character',
610606
[# No expansion inside conversion or for
611607
# the : or ! itself.

0 commit comments

Comments
 (0)