]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-99320: remove tests for old-style class from `test_complex` (#99321)
authorNikita Sobolev <mail@sobolevn.me>
Thu, 10 Nov 2022 10:51:22 +0000 (13:51 +0300)
committerGitHub <noreply@github.com>
Thu, 10 Nov 2022 10:51:22 +0000 (10:51 +0000)
Lib/test/test_complex.py

index e046577b935e92145482a8430bab3a3a1db30bff..51ba151505fb544ac7b2d0a3d4b1175109af1e9f 100644 (file)
@@ -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))