Issue #28203: Merge from 3.5

This commit is contained in:
Mark Dickinson 2016-09-24 15:28:34 +01:00
commit 6997946ec4
4 changed files with 29 additions and 6 deletions

View file

@ -328,6 +328,14 @@ class ComplexTest(unittest.TestCase):
self.assertRaises(ValueError, complex, "1e1ej")
self.assertRaises(ValueError, complex, "1e++1ej")
self.assertRaises(ValueError, complex, ")1+2j(")
self.assertRaisesRegex(
TypeError,
"first argument must be a string or a number, not 'dict'",
complex, {1:2}, 1)
self.assertRaisesRegex(
TypeError,
"second argument must be a number, not 'dict'",
complex, 1, {1:2})
# the following three are accepted by Python 2.6
self.assertRaises(ValueError, complex, "1..1j")
self.assertRaises(ValueError, complex, "1.11.1j")