def test_clientConnectionFailedStopsReactor(self):
        """
        The reactor can be stopped by a client factory's
        C{clientConnectionFailed} method.
        """
        reactor = self.buildReactor()
        needsRunningReactor(
            reactor, lambda: self.connect(reactor, Stop(reactor)))
        self.runReactor(reactor)

        The reactor can be stopped by a client factory's
        C{clientConnectionFailed} method.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/connectionmixins.py