Fixed mistake in test for f-string error description (GH-22036) (GH-22059) (GH-22060)

(cherry picked from commit 749ed85e44)

Co-authored-by: han-solo <hanish0019@gmail.com>

Co-authored-by: han-solo <hanish0019@gmail.com>
This commit is contained in:
Miss Islington (bot) 2020-09-02 05:13:39 -07:00 committed by GitHub
parent e2977f6202
commit 63fa113c60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -514,7 +514,7 @@ class FormatTest(unittest.TestCase):
def test_with_an_underscore_and_a_comma_in_format_specifier(self): def test_with_an_underscore_and_a_comma_in_format_specifier(self):
error_msg = re.escape("Cannot specify both ',' and '_'.") error_msg = re.escape("Cannot specify both ',' and '_'.")
with self.assertRaisesRegex(ValueError, error_msg): with self.assertRaisesRegex(ValueError, error_msg):
'{:,_}'.format(1) '{:_,}'.format(1)
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()

View File

@ -1227,7 +1227,7 @@ non-important content
def test_with_an_underscore_and_a_comma_in_format_specifier(self): def test_with_an_underscore_and_a_comma_in_format_specifier(self):
error_msg = re.escape("Cannot specify both ',' and '_'.") error_msg = re.escape("Cannot specify both ',' and '_'.")
with self.assertRaisesRegex(ValueError, error_msg): with self.assertRaisesRegex(ValueError, error_msg):
f'{1:,_}' f'{1:_,}'
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()