The problem was coming from the routes
param on the FastAPI class in the main.py file.
app = FastAPI(
title="title",
description="API",
version="0.2",
servers=[{"url": "http://localhost:8000", "description": "Localhost"}],
routes=router.routes, # don't use that !
...
)
When the param is removed, the dependencies are effectively overridden by the fixtures and tests can run with the appropriate session.
I don't know if this a FastAPI issue.