From f31bd85266b8bdb7d95bb6f6e2f6d48967278f9a Mon Sep 17 00:00:00 2001 From: Miroslav Los Date: Wed, 18 Dec 2019 13:29:54 +0100 Subject: Fix tox configuration for coverage Coverage is unable to report on modules unless PYTHONPATH is set. Put test results into separate files for python 2 and 3. Merge coverage of python 2 and 3 in a final report. Silence warnings on xunit2 pytest output format. Signed-off-by: Miroslav Los Issue-ID: DCAEGEN2-2005 Change-Id: I2740231274c153d178e7d9c9103fc70657f7558d --- relationships/tox.ini | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'relationships') diff --git a/relationships/tox.ini b/relationships/tox.ini index 499accb..c734632 100644 --- a/relationships/tox.ini +++ b/relationships/tox.ini @@ -1,13 +1,29 @@ -# 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 coverage pytest-cov commands= - pytest --junitxml xunit-results.xml --cov relationshipplugin --cov-report xml + coverage erase + pytest --junitxml xunit-results.{envname}.xml --cov relationshipplugin + +[testenv:cov] +skip_install = true +deps= + coverage +setenv= + COVERAGE_FILE=.coverage +commands= + coverage combine coverage xml + +[pytest] +junit_family = xunit2 -- cgit 1.2.3-korg