]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-126146: Remove ``__cmp__`` method from tests (#126147)
authorKirill Podoprigora <kirill.bast9@mail.ru>
Tue, 29 Oct 2024 22:47:26 +0000 (00:47 +0200)
committerGitHub <noreply@github.com>
Tue, 29 Oct 2024 22:47:26 +0000 (00:47 +0200)
Remove ``__cmp__`` method from the tests because it was removed in 3.0 version.

Lib/test/test_descr.py
Lib/test/test_richcmp.py

index c8e3a4be26b506019979d054a7fcd2d74a3a05e7..aa801b9c4f7ad9604c8e67e254e72b5ca0fb7e5e 100644 (file)
@@ -3239,8 +3239,6 @@ class ClassPropertiesAndMethods(unittest.TestCase):
             class C(base):
                 def __init__(self, value):
                     self.value = int(value)
-                def __cmp__(self_, other):
-                    self.fail("shouldn't call __cmp__")
                 def __eq__(self, other):
                     if isinstance(other, C):
                         return self.value == other.value
index 5f449cdc05c6bae1afdae79a5edc8b00f7051479..b967c7623c57b01b0e0f1182d31a84128e26fd78 100644 (file)
@@ -28,9 +28,6 @@ class Number:
     def __ge__(self, other):
         return self.x >= other
 
-    def __cmp__(self, other):
-        raise support.TestFailed("Number.__cmp__() should not be called")
-
     def __repr__(self):
         return "Number(%r)" % (self.x, )
 
@@ -53,9 +50,6 @@ class Vector:
     def __bool__(self):
         raise TypeError("Vectors cannot be used in Boolean contexts")
 
-    def __cmp__(self, other):
-        raise support.TestFailed("Vector.__cmp__() should not be called")
-
     def __repr__(self):
         return "Vector(%r)" % (self.data, )