11

I have code that runs conditionally depending on the current version of Python, because I'm supporting 2.6, 2.7, and 3.3 from the same package.

I currently generate a coverage report like this, using the default version of Python:

coverage run --source mypackage setup.py test
coverage report -m
coverage html

This is useful but not ideal, as it only reports coverage on Python 2.7. Instead, I would like to generate a cumulative report of the test coverage across 2.6, 2.7, and 3.2.

How do I generate a multi-version coverage report?

Side note: I've tried putting commands = coverage run --source mypackage setup.py test into my tox.ini for each of py26, py27, py33, but that doesn't seem to generate a cumulative coverage report.

1
  • 1
    I doubt it, since there's a different version of coverage for each version of Python. I suggest you contact Ned and see what he suggests. It's also hard to imagine what such a cumulative coverage report might look like -- other than just being the reports from the different versions concatenated together.
    – martineau
    Commented Aug 24, 2013 at 13:23

1 Answer 1

10

http://nedbatchelder.com/code/coverage/cmd.html#cmd-combining is of use according to the developer.

3
  • 1
    Please add the gist of it - the link might break at some point Commented Jun 17, 2018 at 7:54
  • @MartinThoma the command is coverage combine. If the link breaks, the command might too. Commented Jun 18, 2018 at 9:16
  • The link is dead. Commented Sep 15, 2021 at 21:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.