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

Method assert_total_order

Lib/test/test_compare.py:251–270  ·  view source on GitHub ↗

Test total ordering comparison of two instances. a, b: Instances to be tested (of same or different type). comp: -1, 0, or 1 indicates that the expected order comparison result for operations that are supported by the classes is a <, ==, or > b. a_met

(self, a, b, comp, a_meth=None, b_meth=None)

Source from the content-addressed store, hash-verified

249 b >= a
250
251 def assert_total_order(self, a, b, comp, a_meth=None, b_meth=None):
252 """Test total ordering comparison of two instances.
253
254 a, b: Instances to be tested (of same or different type).
255
256 comp: -1, 0, or 1 indicates that the expected order comparison
257 result for operations that are supported by the classes is
258 a <, ==, or > b.
259
260 a_meth, b_meth: Either None, indicating that all rich comparison
261 methods are available, aa for builtins, or the tuple (subset)
262 of "eq", "ne", "lt", "le", "gt", and "ge" that are available
263 for the corresponding instance (of a user-defined class).
264 """
265 self.assert_eq_subtest(a, b, comp, a_meth, b_meth)
266 self.assert_ne_subtest(a, b, comp, a_meth, b_meth)
267 self.assert_lt_subtest(a, b, comp, a_meth, b_meth)
268 self.assert_le_subtest(a, b, comp, a_meth, b_meth)
269 self.assert_gt_subtest(a, b, comp, a_meth, b_meth)
270 self.assert_ge_subtest(a, b, comp, a_meth, b_meth)
271
272 # The body of each subtest has form:
273 #

Callers 7

test_str_subclassMethod · 0.95
test_numbersMethod · 0.95
test_sequencesMethod · 0.95
test_bytesMethod · 0.95
test_setsMethod · 0.95

Calls 6

assert_eq_subtestMethod · 0.95
assert_ne_subtestMethod · 0.95
assert_lt_subtestMethod · 0.95
assert_le_subtestMethod · 0.95
assert_gt_subtestMethod · 0.95
assert_ge_subtestMethod · 0.95

Tested by

no test coverage detected