diff --git a/pytest_socket.py b/pytest_socket.py index 0c8dd63..4e48643 100644 --- a/pytest_socket.py +++ b/pytest_socket.py @@ -77,7 +77,10 @@ def disable_socket(): class GuardedSocket(socket.socket): """ socket guard to disable socket creation (from pytest-socket) """ def __new__(cls, *args, **kwargs): - raise SocketBlockedError() + if args[0] != socket.AddressFamily.AF_UNIX: + raise SocketBlockedError() + return super().__new__(cls, *args, **kwargs) + socket.socket = GuardedSocket