[TIP] tox & pytest-cov
marius at gedmin.as
Thu Mar 5 08:31:47 PST 2015
On Thu, Mar 05, 2015 at 11:19:13AM +0000, Tom Viner wrote:
> I've got a super simple package here: https://github.com/tomviner/my_package
> And I can't see how to get both:
> - working coverage
> - correct paths reported in my coverage output (terminal or xml etc)
> calling py.test directly works fine:
> $ py.test --cov src/my_package
> src/my_package/__init__ 2 0 100%
> But with tox, I can get either correct 100% coverage report, OR a sensible
> $ tox '--cov src/my_package'
> src/my_package/__init__ 2 2 0%
> $ tox '--cov my_package'
> .tox/py27/lib/python2.7/site-packages/my_package/__init__ 2 0
tox --develop '--cov my_package'
(If you like that, you can make --develop default by adding
'usedevelop = true' to your tox.ini)
> The paths are actually really important because Jenkins tooling will link
> up coloured source files from an xml report.
> Is this a tox issue or a pytest-cov issue?
C is quirky, flawed, and an enormous success.
-- Dennis M. Ritchie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 173 bytes
Desc: Digital signature
More information about the testing-in-python