Relative Content

Tag Archive for pythonpytestfastapi

Testing dependency call args in FastAPI

I have an api with a route that creates google cloud tasks. I import the task client as dependency into the endpoint. I mocked the task client in my tests with app.dependency_overrides but now I’m not sure how to use that in order to see the call args for the send_task_to_queue function. In my old flask api I could just patch send_task_to_queue and check its call_args but trying that here is giving me None