diff options
author | Eric Smith <eric@trueblade.com> | 2008-01-11 00:17:22 (GMT) |
---|---|---|
committer | Eric Smith <eric@trueblade.com> | 2008-01-11 00:17:22 (GMT) |
commit | fc6e8fe5edbeb502d6eb699c7c7aa3f00396667f (patch) | |
tree | 3ca38a6cbb73413fa25e3a17059e3367d38f6851 /Lib | |
parent | 0041223f51ffc267417dbd697716add494735b3a (diff) | |
download | cpython-fc6e8fe5edbeb502d6eb699c7c7aa3f00396667f.zip cpython-fc6e8fe5edbeb502d6eb699c7c7aa3f00396667f.tar.gz cpython-fc6e8fe5edbeb502d6eb699c7c7aa3f00396667f.tar.bz2 |
Simplifed argument parsing in object.__format__, added test case.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_builtin.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index be6f391..c5bb54a 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -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') |