Fix tox configuration for coverage
[dcaegen2/platform/plugins.git] / dcae-policy / tox.ini
index 42a4c39..2315666 100644 (file)
@@ -1,8 +1,11 @@
-# content of: tox.ini , put in same dir as setup.py
 [tox]
-envlist = py27,py36
+envlist = py27,py36,cov
 
 [testenv]
+# coverage can only find modules if pythonpath is set
+setenv=
+    PYTHONPATH={toxinidir}
+    COVERAGE_FILE=.coverage.{envname}
 deps=
     -rrequirements.txt
     pytest
@@ -12,5 +15,18 @@ whitelist_externals=
     /bin/mkdir
 commands=
     mkdir -p logs
-    pytest --junitxml xunit-results.xml --cov dcaepolicyplugin --cov-report xml
+    coverage erase
+    pytest --junitxml xunit-results.{envname}.xml --cov dcaepolicyplugin
+
+[testenv:cov]
+skip_install = true
+deps=
+    coverage
+setenv=
+    COVERAGE_FILE=.coverage
+commands=
+    coverage combine
     coverage xml
+
+[pytest]
+junit_family = xunit2