def METHOD_NAME(app_mock, schema):
    exception = Exception("Test exception")
    app_mock = Mock(side_effect=exception)
    middleware = GraphQLMiddleware(app_mock, schema)
    handle_request = middleware.graphql_app.handle_request = Mock()
    with pytest.raises(Exception) as excinfo:
        middleware({"PATH_INFO": "/"}, Mock())
    assert excinfo.value is exception
    assert not handle_request.called