Вопрос

I am using coverage.py on my code (python 2.7), inside PyDEV on Windows.

I have bits of code that run only on UNIX, usually starting with:

if os.name == 'posix':

and I want to make sure this is covered as well. Somehow to run coverage on UNIX, and merge the results to PyDEV.

I have no clue how to achieve it, though.

Это было полезно?

Решение

This is more of an intergration issue.

  1. You will have to run the test on different machines (but can be a remote or virtual machine) in order to test for different operating systems.
  2. You may want to integrate or automate these tests as a long-term solution. There are many continuous integration software for this.
  3. If you need to collect coverage data from different machines or processes, coverage can combine multiple files into one for reporting. Use the -p flag during execution to append distinguishing information to the .coverage data file name.
    Details can be found on the coverage.py documentation site.
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top