def METHOD_NAME():
    # Converse to the above test. This does not cover any of our code, just FastAPI
    # behavior.
    async def test():
        yield
        raise HTTPException(status_code=202)
    app = FastAPI()
    router = PrefectRouter()
    @router.get("/")
    def foo(
        x=Depends(test),
    ):
        pass
    app.include_router(router)
    client = TestClient(app)
    if packaging.version.parse(fastapi.__version__) < packaging.version.parse("0.74.0"):
        # The exception is raised in the app (and consequently here) instead of in
        # the response
        expected_type = HTTPException
        match = ".*"
    else:
        # In newer FastAPI versions, FastAPI raises a runtime error complaining about
        # an exception during the response
        expected_type = RuntimeError
        match = "Caught handled exception, but response already started"
    with pytest.raises(expected_type, match=match):
        client.get("/")