#17080: improve error message of float/complex when the wrong type is passed.

This commit is contained in:
Ezio Melotti 2013-11-07 19:18:34 +02:00
parent d0786a1a50
commit a5b9599538
4 changed files with 11 additions and 6 deletions

View file

@ -41,6 +41,7 @@ class GeneralFloatCases(unittest.TestCase):
self.assertRaises(ValueError, float, "-.")
self.assertRaises(ValueError, float, b"-")
self.assertRaises(TypeError, float, {})
self.assertRaisesRegex(TypeError, "not 'dict'", float, {})
# Lone surrogate
self.assertRaises(UnicodeEncodeError, float, '\uD8F0')
# check that we don't accept alternate exponent markers