def test_applicationExceptionBeforeStartResponse(self):
        """
        If the application raises an exception before calling I{start_response}
        then the response status is I{500} and the exception is logged.
        """
        def application(environ, startResponse):
            raise RuntimeError("This application had some error.")
        return self._internalServerErrorTest(application)

        If the application raises an exception before calling I{start_response}
        then the response status is I{500} and the exception is logged.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_wsgi.py