https://github.com/dgonzo27/flask-testing-demo
Dockerized Flask API and Test Suite with pytest
https://github.com/dgonzo27/flask-testing-demo
docker docker-compose flask flask-restx postgresql pytest pytest-cov python
Last synced: 7 months ago
JSON representation
Dockerized Flask API and Test Suite with pytest
- Host: GitHub
- URL: https://github.com/dgonzo27/flask-testing-demo
- Owner: dgonzo27
- Created: 2022-01-08T20:52:07.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-08T20:53:05.000Z (over 3 years ago)
- Last Synced: 2025-01-22T09:42:32.221Z (9 months ago)
- Topics: docker, docker-compose, flask, flask-restx, postgresql, pytest, pytest-cov, python
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# flask-testing-demo
watch the demo [youtube](https://youtu.be/frraTxO5j08)## getting started
1. build the docker containers:```sh
docker compose build
```2. run the containers in detached mode:
```sh
docker compose up -d
```3. recreate the database:
```sh
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:
```sh
docker compose down
```## test suite
1. build and run the containers:```sh
docker compose build && docker compose up -d
```2. execute the test suite:
```sh
docker compose exec api python -m pytest "app/tests" -p no:warnings --cov="app"
```