Add coverage reporting

Tox target: cover
Exclude:
    tests
    dummy driver
    migrations
    configs
Report: console and html
Threshold: 65%
Current state: 70%

Change-Id: I3d0bb682ed499167e169789d7a222e8ce4637457
This commit is contained in:
Alexey Stepanov 2016-05-16 13:45:56 +03:00
parent 2dd7fd1fae
commit bdb20d5439
2 changed files with 19 additions and 1 deletions

9
.coveragerc Normal file
View File

@ -0,0 +1,9 @@
[run]
source =
devops
omit =
devops/tests/*
devops/migrations/*
devops/driver/dummy/*
devops/settings.py
devops/test_settings.py

11
tox.ini
View File

@ -5,7 +5,7 @@
[tox]
minversion = 1.6
envlist = pep8, py{27,34,35}, pylint, pylint-py{27,34,35}
envlist = pep8, py{27,34,35}, pylint, pylint-py{27,34,35}, cover
skipsdist = True
[testenv]
@ -20,6 +20,15 @@ commands =
[testenv:venv]
commands = {posargs:}
[testenv:cover]
deps =
pytest-cov
-r{toxinidir}/test-requirements.txt
commands =
py.test --cov-config .coveragerc --cov-report html --cov=devops devops/tests
coverage report --fail-under 65
[testenv:pep8]
deps = hacking==0.10.1
usedevelop = False