[Python-3000-checkins] r59901 - python/branches/py3k/Lib/test/test_builtin.py

eric.smith python-3000-checkins at python.org
Fri Jan 11 01:32:16 CET 2008


Author: eric.smith
Date: Fri Jan 11 01:32:16 2008
New Revision: 59901

Modified:
   python/branches/py3k/Lib/test/test_builtin.py
Log:
Added the test cases I actually meant to add.

Modified: python/branches/py3k/Lib/test/test_builtin.py
==============================================================================
--- python/branches/py3k/Lib/test/test_builtin.py	(original)
+++ python/branches/py3k/Lib/test/test_builtin.py	Fri Jan 11 01:32:16 2008
@@ -562,6 +562,11 @@
         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')
 


More information about the Python-3000-checkins mailing list