diff options
author | Mark Dickinson <mdickinson@enthought.com> | 2012-11-14 17:08:31 (GMT) |
---|---|---|
committer | Mark Dickinson <mdickinson@enthought.com> | 2012-11-14 17:08:31 (GMT) |
commit | d20fb8219554989f3ed901c144014d2f4c5a300a (patch) | |
tree | 8cdc39318d3ce7f8bf6fa16ab73795eceae238e5 /Lib/test/test_complex.py | |
parent | 2eb2f5e3597499b0c72b50bb5ed26da0e1cb65b9 (diff) | |
download | cpython-d20fb8219554989f3ed901c144014d2f4c5a300a.zip cpython-d20fb8219554989f3ed901c144014d2f4c5a300a.tar.gz cpython-d20fb8219554989f3ed901c144014d2f4c5a300a.tar.bz2 |
Issue #16290: __complex__ must now always return an instance of complex.
Diffstat (limited to 'Lib/test/test_complex.py')
-rw-r--r-- | Lib/test/test_complex.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_complex.py b/Lib/test/test_complex.py index 6b34ddc..2a85bf4 100644 --- a/Lib/test/test_complex.py +++ b/Lib/test/test_complex.py @@ -221,6 +221,8 @@ class ComplexTest(unittest.TestCase): self.assertRaises(TypeError, complex, OS(None)) self.assertRaises(TypeError, complex, NS(None)) self.assertRaises(TypeError, complex, {}) + self.assertRaises(TypeError, complex, NS(1.5)) + self.assertRaises(TypeError, complex, NS(1)) self.assertAlmostEqual(complex("1+10j"), 1+10j) self.assertAlmostEqual(complex(10), 10+0j) |