PyDocs

Development Tools

test.support.socket_helper

The test.support.socket_helper module provides support for socket tests.
Symbols in test.support.socket_helper

b

bind_port
Bind the socket to a free port and return the port number.
bind_unix_socket
Bind a Unix socket, raising unittest.SkipTest if PermissionError is raised.

f

find_unused_port
Returns an unused port that should be suitable for binding.

i

IPV6_ENABLED
Set to True if IPv6 is enabled on this host, False otherwise.

s

skip_unless_bind_unix_socket
A decorator for running tests that require a functional bind() for Unix sockets.

t

transient_internet
A context manager that raises ResourceDenied when various issues with the internet connection manifest themselves as exceptions.