MCPcopy Create free account
hub / github.com/encode/starlette / CustomIterable

Class CustomIterable

tests/test_concurrency.py:51–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49@pytest.mark.anyio
50async def test_iterate_in_threadpool() -> None:
51 class CustomIterable:
52 def __iter__(self) -> Iterator[int]:
53 yield from range(3)
54
55 assert [v async for v in iterate_in_threadpool(CustomIterable())] == [0, 1, 2]

Callers 1

Calls

no outgoing calls

Tested by 1