def connectionMade(self):
                """
                Set up a callback on clientPaused to lose the connection.
                """
                msg('Disconnector.connectionMade')
                def disconnect(ignored):
                    msg('Disconnector.connectionMade disconnect')
                    self.transport.loseConnection()
                    msg('loseConnection called')
                clientPaused.addCallback(disconnect)

                Set up a callback on clientPaused to lose the connection.
                
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_tcp.py