summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2022-11-10 10:51:22 (GMT)
committerGitHub <noreply@github.com>2022-11-10 10:51:22 (GMT)
commit26726c76494d85c7b565b764c732dd4473458409 (patch)
treed81b82b85d3e1efa77d0b8d7a7fc68110bcd87af /Lib
parentd6f276799754f0eab24e1c195d6dca1bc0aadf14 (diff)
downloadcpython-26726c76494d85c7b565b764c732dd4473458409.zip
cpython-26726c76494d85c7b565b764c732dd4473458409.tar.gz
cpython-26726c76494d85c7b565b764c732dd4473458409.tar.bz2
gh-99320: remove tests for old-style class from `test_complex` (#99321)
Diffstat (limited to 'Lib')
-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 e046577..51ba151 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))