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

Class MySizedIterable

testing/python/approx.py:864–869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

862
863 def test_generic_sized_iterable_object(self):
864 class MySizedIterable:
865 def __iter__(self):
866 return iter([1, 2, 3, 4])
867
868 def __len__(self):
869 return 4
870
871 expected = MySizedIterable()
872 assert [1, 2, 3, 4] == approx(expected)

Callers 1

Calls

no outgoing calls

Tested by 1