Module covercp
source code
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:
http://www.garethrees.org/2001/12/04/python-coverage/
or Ned Batchelder's enhanced version:
http://www.nedbatchelder.com/code/modules/coverage.html
To turn on coverage tracing, use the following code:
cherrypy.engine.on_start_engine_list.insert(0, covercp.start)
cherrypy.engine.on_start_thread_list.insert(0, covercp.start)
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.
|
|
|
|
|
_show_branch(root,
base,
path,
pct=0,
showpct=False,
exclude='
' ) |
source code
|
|
|
|
|
|
|
get_tree(base,
exclude)
Return covered module names as a nested dict. |
source code
|
|
|
serve(path=' /tmp/buildd/cherrypy3-3.0.2/cherrypy/lib/coverage.cache ' ,
port=8080) |
source code
|
|
localFile
- Value:
' /tmp/buildd/cherrypy3-3.0.2/cherrypy/lib/coverage.cache '
|
|
TEMPLATE_MENU
- Value:
''' <html>
<head>
<title>CherryPy Coverage Menu</title>
<style>
body {font: 9pt Arial, serif;}
#tree {
font-size: 8pt;
font-family: Andale Mono, monospace;
...
|
|
TEMPLATE_FORM
- Value:
'''
<div id="options">
<form action=\'menu\' method=GET>
<input type=\'hidden\' name=\'base\' value=\'%(base)s\' />
Show percentages <input type=\'checkbox\' %(showpct)s name=\'showp
ct\' value=\'checked\' /><br />
Hide files over <input type=\'text\' id=\'pct\' name=\'pct\' value
=\'%(pct)s\' size=\'3\' />%%<br />
...
|
|
TEMPLATE_FRAMESET
- Value:
''' <html>
<head><title>CherryPy coverage data</title></head>
<frameset cols=\'250, 1*\'>
<frame src=\'menu?base=/tmp/buildd/cherrypy3-3.0.2/cherrypy\' />
<frame name=\'main\' src=\'\' />
</frameset>
</html>
'''
|
|
TEMPLATE_COVERAGE
- Value:
''' <html>
<head>
<title>Coverage for %(name)s</title>
<style>
h2 { margin-bottom: .25em; }
p { margin: .25em; }
.covered { color: #000; background-color: #fff; }
.notcovered { color: #fee; background-color: #500; }
...
|
|
TEMPLATE_LOC_COVERED
- Value:
''' <tr class="covered">
<td class="lineno">%s </td>
<td>%s</td>
</tr>
'''
|
|
TEMPLATE_LOC_NOT_COVERED
- Value:
''' <tr class="notcovered">
<td class="lineno">%s </td>
<td>%s</td>
</tr>
'''
|
|
TEMPLATE_LOC_EXCLUDED
- Value:
''' <tr class="excluded">
<td class="lineno">%s </td>
<td>%s</td>
</tr>
'''
|
|
TEMPLATE_ITEM
- Value:
''' %s%s<a class=\'file\' href=\'report?name=%s\' target=\'main\'>%s</a
>
'''
|
|
__warningregistry__
- Value:
{ ( ' No code coverage will be performed; coverage.py could not be import
ed. ' ,
<class exceptions.UserWarning at 0x401c4e6c>,
43) : 1}
|
|