MCPcopy Index your code
hub / github.com/python/cpython / test_total_ordering_gt

Method test_total_ordering_gt

Lib/test/test_functools.py:1301–1316  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1299 self.assertFalse(A(1) >= A(2))
1300
1301 def test_total_ordering_gt(self):
1302 @functools.total_ordering
1303 class A:
1304 def __init__(self, value):
1305 self.value = value
1306 def __gt__(self, other):
1307 return self.value > other.value
1308 def __eq__(self, other):
1309 return self.value == other.value
1310 self.assertTrue(A(1) < A(2))
1311 self.assertTrue(A(2) > A(1))
1312 self.assertTrue(A(1) <= A(2))
1313 self.assertTrue(A(2) >= A(1))
1314 self.assertTrue(A(2) <= A(2))
1315 self.assertTrue(A(2) >= A(2))
1316 self.assertFalse(A(2) < A(1))
1317
1318 def test_total_ordering_ge(self):
1319 @functools.total_ordering

Callers

nothing calls this directly

Calls 3

assertTrueMethod · 0.80
assertFalseMethod · 0.80
AClass · 0.70

Tested by

no test coverage detected