def test_logoutOnError(self):
        """
        The realm's logout callback is also invoked if there is an error
        generating the response (for example, if the client disconnects
        early).
        """
        request = self._logoutTest()
        request.processingFailed(
            Failure(ConnectionDone("Simulated disconnect")))
        self.assertEqual(self.realm.loggedOut, 1)

        The realm's logout callback is also invoked if there is an error
        generating the response (for example, if the client disconnects
        early).
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_httpauth.py