From 92a9540a216da88f97ed63ab21d661e31dada835 Mon Sep 17 00:00:00 2001 From: Ramy Asselin Date: Thu, 19 Feb 2015 10:56:04 -0800 Subject: [PATCH] Update tox to generate docs & code coverage output Change-Id: If4991deb68889d47e9530f56b008d005495b070c --- docs/changelog.rst | 1 + test-requirements.txt | 2 ++ tox.ini | 11 ++++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index e0b20ba..c875680 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -44,3 +44,4 @@ Changes in Version 1.0.4 * Added new API - Get API Version * Fixed PEP8 violations +* Added tox environments to run tests with code coverage and to generate the documentation diff --git a/test-requirements.txt b/test-requirements.txt index fdb4d59..12f7bc9 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,3 +4,5 @@ flask Werkzeug flake8 # Used by tox +coverage +sphinx diff --git a/tox.ini b/tox.ini index e3c34fc..9776c9e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] minversion = 1.6 skipdist = True -envlist = py27, pep8 +envlist = py27,pep8,cover [testenv] setenv = VIRTUAL_ENV={envdir} @@ -13,6 +13,15 @@ deps = -r{toxinidir}/requirements.txt commands = nosetests --tc-file={toxinidir}/test/config.ini -v +[testenv:cover] +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +commands = + nosetests --with-coverage --cover-package=hplefthandclient --cover-html --tc-file={toxinidir}/test/config.ini -v + +[testenv:docs] +commands = sphinx-build -b html docs docs/html + [testenv:pep8] commands = flake8 {posargs} hplefthandclient test