'Return a socket which times out on connect'

@contextlib.contextmanager
def mocked_socket_module(self):

    old_socket = socket.socket
    socket.socket = self.MockSocket
    try:
        (yield)
    finally:
        socket.socket = old_socket
