summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_complex.py
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2016-09-24 14:26:36 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2016-09-24 14:26:36 (GMT)
commit613f8e513cf171a335318221b6050d470a1d765f (patch)
tree3fe6661b6a39246e34d85745b8bbd836cbcb7623 /Lib/test/test_complex.py
parent8609cda961a773f6eaafe7944f73d70407500ac7 (diff)
downloadcpython-613f8e513cf171a335318221b6050d470a1d765f.zip
cpython-613f8e513cf171a335318221b6050d470a1d765f.tar.gz
cpython-613f8e513cf171a335318221b6050d470a1d765f.tar.bz2
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 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")