/flask-testing-demo

Dockerized Flask API and Test Suite with pytest

Primary LanguagePython

flask-testing-demo

watch the demo youtube

getting started

  1. build the docker containers:

    docker compose build
  2. run the containers in detached mode:

    docker compose up -d
  3. recreate the database:

    docker compose exec api python manage.py recreate_db
  4. visit http://localhost:5000/api/v1/docs to create, read, update and delete movies

  5. stop the containers:

    docker compose down

test suite

  1. build and run the containers:

    docker compose build && docker compose up -d
  2. execute the test suite:

    docker compose exec api python -m pytest "app/tests" -p no:warnings --cov="app"