Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/172243

Change subject: tox env to build test coverage
......................................................................

tox env to build test coverage

The python module `coverage` let you easily generate coverage report. We
are using it for the mediawiki/tools/scap repository already.

Add a tox env `cover` which uses `coverage run python setup.py test` to
capture the output. Then generate a text and HTML reports (under
/htmlcov).

The new env is not invoked by default, one have to:

 tox -ecover

Then open htmlcov/index.html

Change-Id: Ia94d53be8a90ef50b3bf98c405e9c0994bc58c59
---
M .gitignore
M tox.ini
2 files changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/debs/pybal 
refs/changes/43/172243/1

diff --git a/.gitignore b/.gitignore
index 3984a94..a19910e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
 pybal.egg-info
 *.pyc
 .tox
+/.coverage
+/htmlcov
diff --git a/tox.ini b/tox.ini
index bd4f12b..92709b6 100644
--- a/tox.ini
+++ b/tox.ini
@@ -5,6 +5,13 @@
 commands = {envpython} setup.py test
 deps = twisted
 
+[testenv:cover]
+commands = coverage run setup.py test
+           coverage report --omit=".tox*,tests/*,setup.py"
+           coverage html --omit=".tox*,tests/*,setup.py"
+deps = twisted
+       coverage
+
 [testenv:flake8]
 commands = flake8
 deps = flake8

-- 
To view, visit https://gerrit.wikimedia.org/r/172243
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia94d53be8a90ef50b3bf98c405e9c0994bc58c59
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/pybal
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to