mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-99320: remove tests for old-style class from test_complex
(GH-99321)
(cherry picked from commit 26726c7649
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
7c9c993945
commit
921f235367
1 changed files with 1 additions and 6 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue