mirror of
https://github.com/python/cpython.git
synced 2025-08-27 04:05:34 +00:00
Issue #29193: A format string argument for string.Formatter.format()
is now positional-only.
This commit is contained in:
parent
b37f3f6e6b
commit
009b0a1fac
5 changed files with 16 additions and 14 deletions
|
@ -48,9 +48,8 @@ class ModuleTest(unittest.TestCase):
|
|||
self.assertEqual(fmt.format("-{format_string}-", format_string='test'),
|
||||
'-test-')
|
||||
self.assertRaises(KeyError, fmt.format, "-{format_string}-")
|
||||
with self.assertWarnsRegex(DeprecationWarning, "format_string"):
|
||||
self.assertEqual(fmt.format(arg='test', format_string="-{arg}-"),
|
||||
'-test-')
|
||||
with self.assertRaisesRegex(TypeError, "format_string"):
|
||||
fmt.format(format_string="-{arg}-", arg='test')
|
||||
|
||||
def test_auto_numbering(self):
|
||||
fmt = string.Formatter()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue