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

Method test_sequences

Lib/test/test_compare.py:443–462  ·  view source on GitHub ↗

Compare list, tuple, and range.

(self)

Source from the content-addressed store, hash-verified

441 self.assert_equality_only(n1, c1, True)
442
443 def test_sequences(self):
444 """Compare list, tuple, and range."""
445 l1 = [1, 2]
446 l2 = [2, 3]
447 self.assert_total_order(l1, l1, 0)
448 self.assert_total_order(l1, l2, -1)
449
450 t1 = (1, 2)
451 t2 = (2, 3)
452 self.assert_total_order(t1, t1, 0)
453 self.assert_total_order(t1, t2, -1)
454
455 r1 = range(1, 2)
456 r2 = range(2, 2)
457 self.assert_equality_only(r1, r1, True)
458 self.assert_equality_only(r1, r2, False)
459
460 self.assert_equality_only(t1, l1, False)
461 self.assert_equality_only(l1, r1, False)
462 self.assert_equality_only(r1, t1, False)
463
464 def test_bytes(self):
465 """Compare bytes and bytearray."""

Callers

nothing calls this directly

Calls 2

assert_total_orderMethod · 0.95
assert_equality_onlyMethod · 0.95

Tested by

no test coverage detected