test(io): remove unused duplicate freeport() function

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
This commit is contained in:
Taimoor Zaeem
2025-09-17 14:41:03 +00:00
committed by Wolfgang Walther
parent 2b8f8c4c47
commit ef3a25a626
-8
View File
@@ -24,14 +24,6 @@ class Thread(threading.Thread):
raise self._exception raise self._exception
def freeport():
"Find a free port on localhost."
with contextlib.closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s:
s.bind(("", 0))
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
return s.getsockname()[1]
def authheader(token): def authheader(token):
"Bearer token HTTP authorization header." "Bearer token HTTP authorization header."
return {"Authorization": f"Bearer {token}"} return {"Authorization": f"Bearer {token}"}