Just run:
docker compose up --build --exit-code-from run-tests
Start postgres through docker compose:
pip install python-dotenv
touch .env
Set env variable DATABASE_URI in .env file
export DATABASE_URI=postgresql://username:password@localhost:5432/dbname
Install test requirements
pip install -R tests/requirements.txt
Run tests
pytest