The default approach involves using TestClient. However, I found that mocking the database, background tasks, etc., is overkill. Do you have any suggestions?
The default approach involves using TestClient. However, I found that mocking the database, background tasks, etc., is overkill. Do you have any suggestions?
2 Comments
bradbeattie@lemmy.ca · 1 pts · 295d
If you don't want to test the round trip, have your fastapi routes call some other function and test just that function.
vi21@lemmy.ml · 1 pts · 261d
Do you mean moving Pydantic models as arguments of other function?