Skip test_command_procinfo.py if unable to bind to address (#3079)

* Modified test_command_procinfo.py to skip test if unable to bind to address

* Skip test_command_procinfo.py if unable to bind to address
pull/3081/head
Allen Chang 6 months ago committed by GitHub
parent aea4af6134
commit dd01498159
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -19,7 +19,10 @@ class TCPServerThread(threading.Thread):
self.sock = socket.socket(
socket.AF_INET6 if ":" in ip else socket.AF_INET, socket.SOCK_STREAM
)
self.sock.bind((ip, port))
try:
self.sock.bind((ip, port))
except OSError:
pytest.skip(f"Could not bind to {ip}:{port}.")
self.port = self.sock.getsockname()[1]
self.sock.listen(1)

Loading…
Cancel
Save