Support coverage

This patch provides coverage support in order to check quality of
the code.

Change-Id: Id962288fee3d57b679fc126ef7b498d6d34598f2
This commit is contained in:
Hisashi Osanai 2016-07-04 04:37:37 +00:00
parent db31acebf9
commit c752cc0bfe
3 changed files with 12 additions and 3 deletions

2
.gitignore vendored
View File

@ -9,3 +9,5 @@
.vagrant
.idea
.tox
.coverage
cover

View File

@ -1,5 +1,6 @@
# mock object framework
coverage>=3.6 # Apache-2.0
hacking>=0.10.2
flake8>=2.2.4
nose==1.3.0
mock>=1.0.1
mock>=1.0.1

10
tox.ini
View File

@ -1,7 +1,7 @@
[tox]
minversion = 2.0
skipsdist = True
envlist = py27,pep8
envlist = py27,pep8,cover
[testenv]
usedevelop = True
@ -16,10 +16,16 @@ deps = -r{toxinidir}/requirements.txt
whitelist_externals = bash
find
commands =
find ./ -type f -name "*.pyc" -delete
find ./ -type f -name "*.py[c|o]" -delete
nosetests -w test
[testenv:cover]
setenv = VIRTUAL_ENV={envdir}
NOSE_WITH_COVERAGE=1
NOSE_COVER_BRANCHES=1
NOSE_COVER_HTML=1
NOSE_COVER_HTML_DIR={toxinidir}/cover
PYTHONPATH={homedir}/spark/spark-1.6.1/python:{homedir}/spark/spark-1.6.1/python/lib/py4j-0.9-src.zip:
[testenv:pep8]
commands =