<div dir="ltr">Hi all,<div><br></div><div>I&#39;ve been searching for a recipe for computing combined code coverage while running Tox to against multiple versions of dependencies.</div><div><br></div><div>I found an old thread on this list (dates back to Aug 2011) that discusses this, but there is no clear conclusion:</div><div><br></div><div>    <a href="http://lists.idyll.org/pipermail/testing-in-python/2011-August/004310.html">http://lists.idyll.org/pipermail/testing-in-python/2011-August/004310.html</a></div><div><br></div><div>I&#39;ve managed to hack something using some hints from there and some other tips here and there.  Here&#39;s a stripped-down version of what I&#39;m using ATM:</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>[tox]</div></div><div><div>envlist = py34,py27,coverage</div></div><div><br></div><div><div>[testenv:py34]</div></div><div><div>deps =</div></div><div><div>  nose</div></div><div><div>  coverage</div></div><div><div>setenv =</div></div><div><div>  COVERAGE_FILE=.coverage.{envname}</div></div><div><div>commands =</div></div><div><div>  python setup.py check</div></div><div><div>  coverage run -m nose greet</div></div><div><br></div><div><div>[testenv:py27]</div></div><div><div>deps =</div></div><div><div>  nose</div></div><div><div>  coverage</div></div><div><div>setenv =</div></div><div><div>  COVERAGE_FILE=.coverage.{envname}</div></div><div><div>commands =</div></div><div><div>  python setup.py check</div></div><div><div>  coverage run -m nose greet</div></div><div><br></div><div><div>[testenv:coverage]</div></div><div><div>deps =</div></div><div><div>  coverage</div></div><div><div>commands =</div></div><div><div>  coverage combine</div></div><div><div>  coverage report --show-missing --fail-under=100</div></div></blockquote><div><br></div><div>Notice that I&#39;m using the &quot;envlist&quot; setting to force the &quot;coverage&quot; environment to run last.  This has the downside that I must list *all* environments there.  Appart from being tedious to read (CSV on one single line), I get the risk that someone forgets to add a new environment&#39;s name to the list.</div><div><br></div><div>Do you have any suggestions or know of any alternative ways of doing this?<br></div><div><br></div><div>Thanks!</div><div><br></div><div>André</div></div>