mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Simplifed argument parsing in object.__format__, added test case.
This commit is contained in:
parent
0041223f51
commit
fc6e8fe5ed
2 changed files with 5 additions and 5 deletions
|
@ -558,6 +558,10 @@ class BuiltinTest(unittest.TestCase):
|
|||
# TypeError because self.__format__ returns the wrong type
|
||||
self.assertRaises(TypeError, format, B(), "")
|
||||
|
||||
# TypeError because format_spec is not unicode
|
||||
self.assertRaises(TypeError, format, object(), 4)
|
||||
self.assertRaises(TypeError, format, object(), object())
|
||||
|
||||
# make sure we can take a subclass of str as a format spec
|
||||
self.assertEqual(format(0, C('10')), ' 0')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue