diff options
author | Eric Smith <eric@trueblade.com> | 2008-01-11 00:32:16 (GMT) |
---|---|---|
committer | Eric Smith <eric@trueblade.com> | 2008-01-11 00:32:16 (GMT) |
commit | 61ecb7768ff04e9918a461a5b4aa692580c9e113 (patch) | |
tree | 05e5295a15969b1d562df1d195fd370bafe0014e | |
parent | fc6e8fe5edbeb502d6eb699c7c7aa3f00396667f (diff) | |
download | cpython-61ecb7768ff04e9918a461a5b4aa692580c9e113.zip cpython-61ecb7768ff04e9918a461a5b4aa692580c9e113.tar.gz cpython-61ecb7768ff04e9918a461a5b4aa692580c9e113.tar.bz2 |
Added the test cases I actually meant to add.
-rw-r--r-- | Lib/test/test_builtin.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index c5bb54a..b10caf5 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -562,6 +562,11 @@ class BuiltinTest(unittest.TestCase): self.assertRaises(TypeError, format, object(), 4) self.assertRaises(TypeError, format, object(), object()) + # first argument to object.__format__ must be string + self.assertRaises(TypeError, object().__format__, 3) + self.assertRaises(TypeError, object().__format__, object()) + self.assertRaises(TypeError, object().__format__, None) + # make sure we can take a subclass of str as a format spec self.assertEqual(format(0, C('10')), ' 0') |