'BlockingConnection TCP/IP connection loss in CONNECTION_START'

def test(self):

    fwd = ForwardServer(remote_addr=(DEFAULT_PARAMS.host, DEFAULT_PARAMS.port), local_linger_args=(1, 0))
    fwd.start()
    self.addCleanup((lambda : (fwd.stop() if fwd.running else None)))
    class MySelectConnection(pika.SelectConnection, ):
        assert hasattr(pika.SelectConnection, '_on_connection_start')
        def _on_connection_start(self, *args, **kwargs):
            fwd.stop()
            return super(MySelectConnection, self)._on_connection_start(*args, **kwargs)
    with self.assertRaises(pika.exceptions.ProbableAuthenticationError):
        self._connect((PARAMS_URL_TEMPLATE % {'port': fwd.server_address[1]}), impl_class=MySelectConnection)
