summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_complex.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_complex.py')
-rw-r--r--Lib/test/test_complex.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/Lib/test/test_complex.py b/Lib/test/test_complex.py
index c6a261b..c9fd6a5 100644
--- a/Lib/test/test_complex.py
+++ b/Lib/test/test_complex.py
@@ -306,15 +306,10 @@ class ComplexTest(unittest.TestCase):
self.assertClose(complex(5.3, 9.8).conjugate(), 5.3-9.8j)
def test_constructor(self):
- class OS:
+ class NS:
def __init__(self, value): self.value = value
def __complex__(self): return self.value
- class NS(object):
- def __init__(self, value): self.value = value
- def __complex__(self): return self.value
- self.assertEqual(complex(OS(1+10j)), 1+10j)
self.assertEqual(complex(NS(1+10j)), 1+10j)
- self.assertRaises(TypeError, complex, OS(None))
self.assertRaises(TypeError, complex, NS(None))
self.assertRaises(TypeError, complex, {})
self.assertRaises(TypeError, complex, NS(1.5))