15 lines
261 B
Python
Raw Normal View History

"""Common support items for rekease teesting."""
from socket import socket
ADDR = "127.56.0.1"
def get_port():
"""Retrieve an unused port."""
sock = socket()
sock.bind((ADDR, 0))
port = sock.getsockname()[1]
sock.close()
return port