From b5d31d5ec7908e528783122f94f1d76d713f9b71 Mon Sep 17 00:00:00 2001 From: Kenji Ishii Date: Wed, 14 Sep 2016 08:49:28 +0900 Subject: [PATCH] Enable test coverage for python in tox At the moment, tox for cover doesn't work well. This patch fix it. Change-Id: Ia02099b29e0710d316a883f85fea4789885ebea6 --- .gitignore | 1 + tox.ini | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6c7bc47..f5ca817 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ npm-debug.log *.lock *.egg* *.swp +.coverage* diff --git a/tox.ini b/tox.ini index 88d4fbc..4ea53f2 100644 --- a/tox.ini +++ b/tox.ini @@ -24,7 +24,11 @@ commands = flake8 {posargs} commands = {posargs} [testenv:cover] -commands = python setup.py test --coverage --testr-args='{posargs}' +commands = + coverage erase + coverage run {toxinidir}/manage.py test zaqar_ui + coverage xml --omit '.tox/cover/*' -o 'cover/coverage.xml' + coverage html --omit '.tox/cover/*' -d 'cover/htmlcov' [testenv:py27dj18] basepython = python2.7