Skip to content

alexjacobs08/fastApi-Integration-tests

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published