diff options
Diffstat (limited to 'Lib/test/test_complex.py')
-rw-r--r-- | Lib/test/test_complex.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_complex.py b/Lib/test/test_complex.py index 0ef9a7a..403ee3b 100644 --- a/Lib/test/test_complex.py +++ b/Lib/test/test_complex.py @@ -326,6 +326,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") |