mirror of
https://github.com/python/cpython.git
synced 2025-07-12 05:45:15 +00:00
#17080: improve error message of float/complex when the wrong type is passed.
This commit is contained in:
parent
d0786a1a50
commit
a5b9599538
4 changed files with 11 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue