def test_connectingToHostnameRaisesInvalidAddressError(self):
        """
        Connecting to a hostname instead of an IP address will raise an
        L{InvalidAddressError}.
        """
        reactor = self.buildReactor()
        port = self.getListeningPort(reactor, DatagramProtocol())
        self.assertRaises(
            error.InvalidAddressError, port.connect, 'example.invalid', 1)

        Connecting to a hostname instead of an IP address will raise an
        L{InvalidAddressError}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_udp.py