Sunday, May 5, 2013

[ Level 2 ] Coverage in Python.

$ sudo pip install coverage
$ coverage run arg1 arg2...
$ coverage report -m
$ coverage html
$ coverage help (run) ## or coverage run --help

Commands of coverage:
    run – Run a Python program and collect execution data.
    report – Report coverage results.
    html – Produce annotated HTML listings with coverage results.
    xml – Produce an XML report with coverage results.
    annotate – Annotate source files with coverage results.
    erase – Erase previously collected coverage data.
    combine – Combine together a number of data files.
    debug – Get diagnostic information.


Wish this helps.

Stanley Huang