def test_connectionLostNotification(self):
        """
        L{Request.connectionLost} triggers all finish notification Deferreds
        and cleans up per-request state.
        """
        d = DummyChannel()
        request = http.Request(d, True)
        finished = request.notifyFinish()
        request.connectionLost(Failure(ConnectionLost("Connection done")))
        self.assertIdentical(request.channel, None)
        return self.assertFailure(finished, ConnectionLost)

        L{Request.connectionLost} triggers all finish notification Deferreds
        and cleans up per-request state.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_http.py