From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 10 Nov 2022 11:22:00 +0000 (-0800) Subject: gh-99320: remove tests for old-style class from `test_complex` (GH-99321) X-Git-Tag: v3.11.1~110 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=921f2353675ded86899c6dfdfc1c5c57bb998638;p=thirdparty%2FPython%2Fcpython.git gh-99320: remove tests for old-style class from `test_complex` (GH-99321) (cherry picked from commit 26726c76494d85c7b565b764c732dd4473458409) Co-authored-by: Nikita Sobolev --- diff --git a/Lib/test/test_complex.py b/Lib/test/test_complex.py index e046577b935e..51ba151505fb 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))