def failOnce(self, reason=Failure(ConnectionRefusedError())):
        """
        Fail a single TCP connection established on this
        L{ConnectionCompleter}'s L{MemoryReactor}.

        @param reason: the reason to provide that the connection failed.
        @type reason: L{Failure}
        """
        self._reactor.tcpClients.pop(0)[2].clientConnectionFailed(
            self._reactor.connectors.pop(0), reason
        )

        Fail a single TCP connection established on this
        L{ConnectionCompleter}'s L{MemoryReactor}.

        @param reason: the reason to provide that the connection failed.
        @type reason: L{Failure}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/iosim.py