docker-compose up -d --build docker-compose down -v docker-compose logs web docker-compose exec web-db psql -U postgres
postgres=# \c web_dev
postgres=# \q docker-compose exec web python app/db.py # normal run
$ docker-compose exec web python -m pytest
# disable warnings
$ docker-compose exec web python -m pytest -p no:warnings
# run only the last failed tests
$ docker-compose exec web python -m pytest --lf
# run only the tests with names that match the string expression
$ docker-compose exec web python -m pytest -k "summary and not test_read_summary"
# stop the test session after the first failure
$ docker-compose exec web python -m pytest -x
# enter PDB after first failure then end the test session
$ docker-compose exec web python -m pytest -x --pdb
# stop the test run after two failures
$ docker-compose exec web python -m pytest --maxfail=2
# show local variables in tracebacks
$ docker-compose exec web python -m pytest -l
# list the 2 slowest tests
$ docker-compose exec web python -m pytest --durations=2
#Run unit tests in parallel
$ docker-compose exec web pytest -k "unit" -n auto http://localhost:8002/docs docker build -f project/Dockerfile.prod -t registry.heroku.com/young-springs-76642/web ./project docker run -d --name fastapi-tdd -e PORT=8765 -e DATABASE_URL=sqlite://sqlite.db -p 5003:8765 registry.heroku.com/young-springs-76642/web:latest docker push registry.heroku.com/young-springs-76642/web:latest
heroku container:release webhttps://young-springs-76642.herokuapp.com/ping/
http://young-springs-76642.herokuapp.com/docs
heroku run python app/db.py -a young-springs-76642 http --json POST https://young-springs-76642.herokuapp.com/summaries/ url=https://testdriven.io docker-compose exec web python -m pytest --cov="." --cov-report html docker-compose exec web black . docker-compose exec web flake8 . docker-compose exec web /bin/sh -c "isort ./**/*.py" docker build -f project/Dockerfile.prod -t docker.pkg.github.com/william-hill/fastapi-tdd-docker/web:latest ./project docker login docker.pkg.github.com -u william-hill -p <TOKEN> docker push docker.pkg.github.com/william-hill/fastapi-tdd-docker/web:latest