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