def finish(self):
        """
        Record that the request is finished and callback and L{Deferred}s
        waiting for notification of this.
        """
        self.finished = self.finished + 1
        if self._finishedDeferreds is not None:
            observers = self._finishedDeferreds
            self._finishedDeferreds = None
            for obs in observers:
                obs.callback(None)

        Record that the request is finished and callback and L{Deferred}s
        waiting for notification of this.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/requesthelper.py