cherrypy.lib.covercp

Code-coverage tools for CherryPy.

To use this module, or the coverage tools in the test suite, you need to download ‘coverage.py’, either Gareth Rees’ original implementation or Ned Batchelder’s enhanced version:

To turn on coverage tracing, use the following code:

cherrypy.engine.subscribe('start', covercp.start)

DO NOT subscribe anything on the ‘start_thread’ channel, as previously recommended. Calling start once in the main thread should be sufficient to start coverage on all threads. Calling start again in each thread effectively clears any coverage data gathered up to that point.

Run your code, then use the covercp.serve() function to browse the results in a web browser. If you run this module from the command line, it will call serve() for you.

Classes

class cherrypy.lib.covercp.CoverStats(coverage, root=None)

Functions

cherrypy.lib.covercp.get_tree(base, exclude, coverage=None)

Return covered module names as a nested dict.

cherrypy.lib.covercp.serve(path='/var/build/user_builds/cherrypy/checkouts/3.3.0/sphinx/source/../../cherrypy/lib/coverage.cache', port=8080, root=None)