diff --git a/.travis.yml b/.travis.yml index 0b7e38fc6..65b2a28d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,8 +13,10 @@ before_install: matrix: include: - - name: Tox test + - name: Test script: tox -e py36 + - name: Black + script: tox -e black - name: Basic Docker script: sh tests/test_docker.sh - name: Docker with Celery diff --git a/tests/test_docker.sh b/tests/test_docker.sh index 64fc77746..007f90208 100755 --- a/tests/test_docker.sh +++ b/tests/test_docker.sh @@ -19,6 +19,9 @@ cd my_awesome_project # run the project's type checks docker-compose -f local.yml run django mypy my_awesome_project +# Run black with --check option +docker-compose -f local.yml run django black --check my_awesome_project + # run the project's tests docker-compose -f local.yml run django pytest diff --git a/tox.ini b/tox.ini index 040c8a41c..cef3efc78 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,11 @@ [tox] skipsdist = true -envlist = py36 +envlist = py36,black [testenv] deps = -rrequirements.txt commands = pytest {posargs:./tests} + +[testenv:black] +deps = black +commands = black --check hooks tests setup.py docs