Combining coverage report, and adding flake8 to tox
This commit is contained in:
parent
fcd362a7a5
commit
97af9a75f9
|
@ -0,0 +1,20 @@
|
|||
[run]
|
||||
source =
|
||||
watson
|
||||
tests
|
||||
|
||||
[report]
|
||||
exclude_lines =
|
||||
# Have to re-enable the standard pragma
|
||||
pragma: no cover
|
||||
|
||||
# Don't complain if tests don't hit defensive assertion code:
|
||||
raise AssertionError
|
||||
raise NotImplementedError
|
||||
assert False
|
||||
|
||||
# Don't complain if tests don't hit model __str__ methods.
|
||||
def __str__
|
||||
|
||||
show_missing = True
|
||||
skip_covered = True
|
18
.travis.yml
18
.travis.yml
|
@ -5,26 +5,14 @@ python:
|
|||
cache:
|
||||
directories:
|
||||
- $HOME/.cache/pip
|
||||
matrix:
|
||||
fast_finish: true
|
||||
env:
|
||||
matrix:
|
||||
- WORKER=python
|
||||
- WORKER=flake8
|
||||
services:
|
||||
- postgresql
|
||||
- mysql
|
||||
install:
|
||||
- pip install tox
|
||||
- pip install flake8
|
||||
before_script:
|
||||
- |
|
||||
if [[ $WORKER == python ]]; then
|
||||
mysql -e 'create database test_project';
|
||||
psql -c 'create database test_project;' -U postgres;
|
||||
fi
|
||||
script:
|
||||
- if [[ $WORKER == python ]]; then tox; fi
|
||||
- if [[ $WORKER == flake8 ]]; then flake8 --jobs=2 . ; fi
|
||||
- mysql -e 'create database test_project';
|
||||
- psql -c 'create database test_project;' -U postgres;
|
||||
script: tox
|
||||
notifications:
|
||||
email: false
|
||||
|
|
18
tox.ini
18
tox.ini
|
@ -1,6 +1,9 @@
|
|||
[tox]
|
||||
envlist =
|
||||
coverage-erase
|
||||
{py27,py34,py35}-django{18,19,110}-{sqlite,postgres,mysql}
|
||||
coverage-report
|
||||
flake8
|
||||
|
||||
[testenv]
|
||||
usedevelop = True
|
||||
|
@ -12,10 +15,19 @@ deps =
|
|||
postgres: psycopg2
|
||||
mysql: mysqlclient
|
||||
commands =
|
||||
sqlite: coverage run tests/runtests.py
|
||||
postgres: coverage run tests/runtests.py -d psql
|
||||
mysql: coverage run tests/runtests.py -d mysql
|
||||
coverage-erase: coverage erase
|
||||
sqlite: coverage run -a tests/runtests.py
|
||||
postgres: coverage run -a tests/runtests.py -d psql
|
||||
mysql: coverage run -a tests/runtests.py -d mysql
|
||||
coverage-report: coverage report
|
||||
|
||||
[flake8]
|
||||
max-line-length=120
|
||||
exclude=build,venv,migrations,south_migrations,.tox
|
||||
|
||||
[testenv:flake8]
|
||||
basepython = python3.5
|
||||
deps =
|
||||
flake8>=2.5.4
|
||||
commands =
|
||||
flake8
|
||||
|
|
Loading…
Reference in New Issue