summaryrefslogtreecommitdiff
path: root/Lib/test/test_complex.py
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2016-09-24 15:26:36 +0100
committerMark Dickinson <dickinsm@gmail.com>2016-09-24 15:26:36 +0100
commit37994a0f046ea627cfc754de58334bc7ab2c46fb (patch)
tree37f2ce2da64f8c37cf4aa7112651c1db9e5fde35 /Lib/test/test_complex.py
parentd75f809264e30b261192360291162575fcd22732 (diff)
downloadcpython-37994a0f046ea627cfc754de58334bc7ab2c46fb.tar.gz
Issue #28203: Fix incorrect type in error message from complex(1.0, {2:3}). Patch by Soumya Sharma.
Diffstat (limited to 'Lib/test/test_complex.py')
-rw-r--r--Lib/test/test_complex.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_complex.py b/Lib/test/test_complex.py
index 0ef9a7a109..403ee3bc58 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")