MCPcopy
hub / github.com/pallets/werkzeug / test_proxy_aiter

Function test_proxy_aiter

tests/test_local.py:567–592  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

565
566
567def test_proxy_aiter():
568 class Example:
569 value = 3
570
571 def __aiter__(self):
572 return self
573
574 async def __anext__(self):
575 if self.value:
576 self.value -= 1
577 return self.value
578
579 raise StopAsyncIteration
580
581 _, p = _make_proxy(Example())
582
583 async def main():
584 out = []
585
586 async for v in p:
587 out.append(v)
588
589 return out
590
591 out = asyncio.run(main())
592 assert out == [2, 1, 0]
593
594
595def test_proxy_async_context_manager():

Callers

nothing calls this directly

Calls 4

_make_proxyFunction · 0.85
ExampleClass · 0.85
mainFunction · 0.85
runMethod · 0.45

Tested by

no test coverage detected