MCPcopy
hub / github.com/python-trio/trio / test_from_fd

Function test_from_fd

src/trio/_tests/test_socket.py:322–328  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

320
321
322async def test_from_fd() -> None:
323 sa, sb = stdlib_socket.socketpair()
324 ta = tsocket.fromfd(sa.fileno(), sa.family, sa.type, sa.proto)
325 with sa, sb, ta:
326 assert ta.fileno() != sa.fileno()
327 await ta.send(b"x")
328 assert sb.recv(3) == b"x"
329
330
331async def test_socketpair_simple() -> None:

Callers

nothing calls this directly

Calls 3

filenoMethod · 0.45
sendMethod · 0.45
recvMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…