Skip to content

Commit 749ed85

Browse files
authored
Fixed mistake in test for f-string error description (GH-22036) (GH-22059)
1 parent 5b24d15 commit 749ed85

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Lib/test/test_format.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ def test_with_a_commas_and_an_underscore_in_format_specifier(self):
514514
def test_with_an_underscore_and_a_comma_in_format_specifier(self):
515515
error_msg = re.escape("Cannot specify both ',' and '_'.")
516516
with self.assertRaisesRegex(ValueError, error_msg):
517-
'{:,_}'.format(1)
517+
'{:_,}'.format(1)
518518

519519
if __name__ == "__main__":
520520
unittest.main()

Lib/test/test_fstring.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,7 @@ def test_with_a_commas_and_an_underscore_in_format_specifier(self):
12171217
def test_with_an_underscore_and_a_comma_in_format_specifier(self):
12181218
error_msg = re.escape("Cannot specify both ',' and '_'.")
12191219
with self.assertRaisesRegex(ValueError, error_msg):
1220-
f'{1:,_}'
1220+
f'{1:_,}'
12211221

12221222
if __name__ == '__main__':
12231223
unittest.main()

0 commit comments

Comments
 (0)