Skip to content

Latest commit

 

History

History
42 lines (33 loc) · 831 Bytes

readme.md

File metadata and controls

42 lines (33 loc) · 831 Bytes

This repo serves as an example for doing integration tests with fastAPI and pytest.

Checkout the accompanying post https://alex-jacobs.com/posts/fastapitests/

Contained is a toy fastAPI app with simple JWT auth and some endpoints to serve as good examples for making integration / API tests.

In tests thee are a number of examples using different patterns for integration testing fastAPI applications.

Install

either use poetry or pip to install the dependencies

poetry install

or

pip install -r requirements.txt

Run Tests

pytest

Run App

uvicorn app.main:app --reload

Build Docker Image

docker build -t fastapi-integration-tests .

Run Docker Image

docker compose up

or

docker run -p 8000:8000 fastapi-integration-tests