tests: rewrite port allocation function

This commit is contained in:
Jörg Thalheim
2023-08-27 09:34:36 +02:00
parent 11dd70bf43
commit 81d02bb218
3 changed files with 52 additions and 38 deletions

View File

@@ -5,11 +5,11 @@ import subprocess
import sys
from pathlib import Path
from ports import Ports
from ports import PortFunction
def test_start_server(ports: Ports, temporary_dir: Path) -> None:
port = ports.allocate(1)
def test_start_server(unused_tcp_port: PortFunction, temporary_dir: Path) -> None:
port = unused_tcp_port()
fifo = temporary_dir / "fifo"
os.mkfifo(fifo)