Skip to content

Commit 32d1680

Browse files
authored
Merge pull request RustPython#4803 from Masorubka1/test_compare
Update test_compare from Cpython v3.11.2
2 parents 07bad48 + 23d6233 commit 32d1680

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

Lib/test/test_compare.py

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import unittest
2+
from test.support import ALWAYS_EQ
23

34
class Empty:
45
def __repr__(self):
@@ -14,13 +15,6 @@ def __repr__(self):
1415
def __eq__(self, other):
1516
return self.arg == other
1617

17-
class Anything:
18-
def __eq__(self, other):
19-
return True
20-
21-
def __ne__(self, other):
22-
return False
23-
2418
class ComparisonTest(unittest.TestCase):
2519
set1 = [2, 2.0, 2, 2+0j, Cmp(2.0)]
2620
set2 = [[1], (3,), None, Empty()]
@@ -113,11 +107,11 @@ class C:
113107

114108
def test_issue_1393(self):
115109
x = lambda: None
116-
self.assertEqual(x, Anything())
117-
self.assertEqual(Anything(), x)
110+
self.assertEqual(x, ALWAYS_EQ)
111+
self.assertEqual(ALWAYS_EQ, x)
118112
y = object()
119-
self.assertEqual(y, Anything())
120-
self.assertEqual(Anything(), y)
113+
self.assertEqual(y, ALWAYS_EQ)
114+
self.assertEqual(ALWAYS_EQ, y)
121115

122116

123117
if __name__ == '__main__':

0 commit comments

Comments
 (0)