diff --git a/tests/integration/test_apidoc.py b/tests/integration/test_apidoc.py index 562f7ccb8e..d488e8f22b 100644 --- a/tests/integration/test_apidoc.py +++ b/tests/integration/test_apidoc.py @@ -1,11 +1,11 @@ -from fastapi.openapi.utils import get_flat_models_from_routes -from fastapi.utils import get_model_definitions -from pydantic.schema import get_model_name_map from starlette.testclient import TestClient +from antarest import __version__ def test_apidoc(client: TestClient) -> None: - # Asserts that the apidoc can be loaded - flat_models = get_flat_models_from_routes(client.app.routes) - model_name_map = get_model_name_map(flat_models) - get_model_definitions(flat_models=flat_models, model_name_map=model_name_map) + # Local import to avoid breaking all tests if FastAPI changes its API + from fastapi.openapi.utils import get_openapi + + routes = client.app.routes + openapi = get_openapi(title="Antares Web", version=__version__, routes=routes) + assert openapi