()
| 225 | |
| 226 | |
| 227 | def choose_loopback_port() -> int: |
| 228 | with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: |
| 229 | sock.bind(("127.0.0.1", 0)) |
| 230 | address = sock.getsockname() |
| 231 | return int(address[1]) |
| 232 | |
| 233 | |
| 234 | def redis_url_host_port(url: str) -> tuple[str, int] | None: |
no test coverage detected