mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +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
|
@ -303,6 +303,7 @@ class ComplexTest(unittest.TestCase):
|
|||
self.assertRaises(TypeError, float, 5+3j)
|
||||
self.assertRaises(ValueError, complex, "")
|
||||
self.assertRaises(TypeError, complex, None)
|
||||
self.assertRaisesRegex(TypeError, "not 'NoneType'", complex, None)
|
||||
self.assertRaises(ValueError, complex, "\0")
|
||||
self.assertRaises(ValueError, complex, "3\09")
|
||||
self.assertRaises(TypeError, complex, "1", "2")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue