def test_cancelConnectTCPFailedTimeout(self):
        """
        Similar to L{test_cancelConnectTCPTimeout}, but for the case where the
        connection attempt fails.
        """
        def connect(reactor, cc):
            d = cc.connectTCP('example.com', 1234)
            host, port, factory, timeout, bindAddress = reactor.tcpClients.pop()
            return d, factory
        return self._cancelConnectFailedTimeoutTest(connect)

        Similar to L{test_cancelConnectTCPTimeout}, but for the case where the
        connection attempt fails.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_protocol.py