[Python-checkins] gh-99320: remove tests for old-style class from `test_complex` (GH-99321)

miss-islington webhook-mailer at python.org
Thu Nov 10 06:19:36 EST 2022


https://github.com/python/cpython/commit/ee405e3b23c85eedf0413f87e74d06e0128a0298
commit: ee405e3b23c85eedf0413f87e74d06e0128a0298
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-11-10T03:19:30-08:00
summary:

gh-99320: remove tests for old-style class from `test_complex` (GH-99321)

(cherry picked from commit 26726c76494d85c7b565b764c732dd4473458409)

Co-authored-by: Nikita Sobolev <mail at sobolevn.me>

files:
M Lib/test/test_complex.py

diff --git a/Lib/test/test_complex.py b/Lib/test/test_complex.py
index c6a261b418b5..c9fd6a5c0a3b 100644
--- a/Lib/test/test_complex.py
+++ b/Lib/test/test_complex.py
@@ -306,15 +306,10 @@ def test_conjugate(self):
         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))



More information about the Python-checkins mailing list