From: Eric Smith Date: Fri, 11 Jan 2008 00:32:16 +0000 (+0000) Subject: Added the test cases I actually meant to add. X-Git-Tag: v3.0a3~210 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=61ecb7768ff04e9918a461a5b4aa692580c9e113;p=thirdparty%2FPython%2Fcpython.git Added the test cases I actually meant to add. --- diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index c5bb54a52e91..b10caf511b8d 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')