MCPcopy Create free account
hub / github.com/pytest-dev/pytest / TestSequence

Class TestSequence

testing/test_assertion.py:671–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

669 def test_Sequence(self) -> None:
670 # Test comparing with a Sequence subclass.
671 class TestSequence(MutableSequence[int]):
672 def __init__(self, iterable):
673 self.elements = list(iterable)
674
675 def __getitem__(self, item):
676 return self.elements[item]
677
678 def __len__(self):
679 return len(self.elements)
680
681 def __setitem__(self, item, value):
682 pass
683
684 def __delitem__(self, item):
685 pass
686
687 def insert(self, item, index):
688 pass
689
690 expl = callequal(TestSequence([0, 1]), list([0, 2]))
691 assert expl is not None

Callers 1

test_SequenceMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_SequenceMethod · 0.68