[Python-checkins] Fixed mistake in test for f-string error description (GH-22036) (GH-22059)

han-solo webhook-mailer at python.org
Wed Sep 2 04:56:42 EDT 2020


https://github.com/python/cpython/commit/749ed85e4446f548e22934931241f644a33d81ce
commit: 749ed85e4446f548e22934931241f644a33d81ce
branch: master
author: han-solo <hanish0019 at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-09-02T04:56:37-04:00
summary:

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

files:
M Lib/test/test_format.py
M Lib/test/test_fstring.py

diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py
index dff8c69032187..d2744cdfdca60 100644
--- a/Lib/test/test_format.py
+++ b/Lib/test/test_format.py
@@ -514,7 +514,7 @@ def test_with_a_commas_and_an_underscore_in_format_specifier(self):
     def test_with_an_underscore_and_a_comma_in_format_specifier(self):
         error_msg = re.escape("Cannot specify both ',' and '_'.")
         with self.assertRaisesRegex(ValueError, error_msg):
-            '{:,_}'.format(1)
+            '{:_,}'.format(1)
 
 if __name__ == "__main__":
     unittest.main()
diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py
index b9bede0d9b800..b53661aa0a46f 100644
--- a/Lib/test/test_fstring.py
+++ b/Lib/test/test_fstring.py
@@ -1217,7 +1217,7 @@ def test_with_a_commas_and_an_underscore_in_format_specifier(self):
     def test_with_an_underscore_and_a_comma_in_format_specifier(self):
         error_msg = re.escape("Cannot specify both ',' and '_'.")
         with self.assertRaisesRegex(ValueError, error_msg):
-            f'{1:,_}'
+            f'{1:_,}'
 
 if __name__ == '__main__':
     unittest.main()



More information about the Python-checkins mailing list