MCPcopy
hub / github.com/encode/uvicorn / stdin_socket

Function stdin_socket

tests/test_config.py:557–566  ·  tests/test_config.py::stdin_socket
()

Source from the content-addressed store, hash-verified

555
556@pytest.fixture
557def stdin_socket() -> Iterator[socket.socket]: class="cm"># pragma: py-win32
558 with closing(socket.socket(socket.AF_INET)) as sock:
559 sock.bind((class="st">"127.0.0.1", 0))
560 saved_stdin = os.dup(0)
561 os.dup2(sock.fileno(), 0)
562 try:
563 yield sock
564 finally:
565 os.dup2(saved_stdin, 0)
566 os.close(saved_stdin)
567
568
569@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected