Skip to content

Developing and Testing an Asynchronous API with FastAPI and Pytest

Objectives

By the end of this tutorial you should be able to:

  • Develop an asynchronous RESTful API with Python and FastAPI
  • Practice Test-driven Development
  • Test a FastAPI app with pytest
  • Interact with a Postgres database asynchronously
  • Containerize FastAPI and Postgres inside a Docker container
  • Parameterize test functions and mock functionality in tests with pytest
  • Document a RESTful API with Swagger/OpenAPI