@alfredodeza The custom side effect function is implemented because the code uses socket.getaddrinfo both to check if a hostname is resolvable and to check that it is not an IPv4/IPv6 address. To validate this getaddrinfo must first succeed while resolving the hostname and throw an exception when checking if the hostname is a IPv4/IPv6 address.

The original implementation got away with default side_effect behaviour because it used different functions for the first and second check. Now we use the same for both checks and I believe this is the best way to test it.

Please have a look at my updated patch where I have removed the tabs you pointed out and documented the need for the side_effect function with a comment.

Please give me additional feedback if you think there is more work to be done on this.

Cheers! :-)