pythondjangocode-coveragetoxpython-coverage

How calculate the global coverage?


I am using tox to test my python egg. And I want to know the coverage.

But the problem is that the tests are executing with python 2 (2.6 and 2.7) and python 3 (3.3) and some lines should be executed in python 2 and other in python 3, but this look like if only count the lines that are executed with python 2 (the last section in the tox, py26-dj12). You can see this here:

https://coveralls.io/files/64922124#L33

Of this way pass with the differents django version...

Is there some way to get the global coverage?


Solution

  • Yesterday I receipted an email answering this question:

    coverage.py (the tool coveralls uses to measure coverage in Python programs) has a "coverage combine" command.

    Yesterday, I got the global coverage executing something like this:

    coverage erase
    tox
    coverage combine
    coveralls
    

    In tox.ini I added the "p" param:

    python {envbindir}/coverage run -p testing/run_tests.py
    python {envbindir}/coverage run -p testing/run_tests.py testing.settings_no_debug
    

    I fixed the problem with these commits: