diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..330a2cd --- /dev/null +++ b/.coveragerc @@ -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 diff --git a/.travis.yml b/.travis.yml index 265da0c..9f572b4 100644 --- a/.travis.yml +++ b/.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 diff --git a/tox.ini b/tox.ini index a1855c7..72a37bf 100644 --- a/tox.ini +++ b/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