move_on_after(..., shield=True):
s, r = anyio.create_memory_object_stream(float('inf'), item_type=str)
bt = BufferedTextReceiveStream(r)
with s, r:
await s.send("foo")
assert await bt.receive() == "foo"
await s.send("bar")
assert await bt.receive_exactly(1) == "b"
assert await bt.receive_exactly(2) == "ar"
await s.send("baz")
assert await bt.receive_until("a", 100) == "b"
assert await bt.receive_exactly(1) == "z"
unused_tcp_port
fixture. Which I'm not sure why it exists there... But is it interesting for AnyIO to have it as well?