79448115

Date: 2025-02-18 11:43:46
Score: 0.5
Natty:
Report link

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.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Renato