summaryrefslogtreecommitdiff
path: root/cherrypy/lib/covercp.py
diff options
context:
space:
mode:
authorRobert Brewer <fumanchu@aminus.org>2006-06-12 04:11:53 +0000
committerRobert Brewer <fumanchu@aminus.org>2006-06-12 04:11:53 +0000
commita62559f98015e3466ed9d4277a422c8ef7bc984a (patch)
tree61791f610cecd1279c56a700b13beea07d739cce /cherrypy/lib/covercp.py
parent2be455dc9de6eea126e2513aeac23c6e0b4c155d (diff)
downloadcherrypy-git-a62559f98015e3466ed9d4277a422c8ef7bc984a.tar.gz
Moved coverage out of the core.
Diffstat (limited to 'cherrypy/lib/covercp.py')
-rw-r--r--cherrypy/lib/covercp.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/cherrypy/lib/covercp.py b/cherrypy/lib/covercp.py
index 51278c88..1ef53fb3 100644
--- a/cherrypy/lib/covercp.py
+++ b/cherrypy/lib/covercp.py
@@ -8,9 +8,14 @@ http://www.garethrees.org/2001/12/04/python-coverage/
or Ned Batchelder's enhanced version:
http://www.nedbatchelder.com/code/modules/coverage.html
-Set "cherrypy.codecoverage = True" to turn on coverage tracing.
-Then, use the 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.
+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.
"""
import re
@@ -27,7 +32,7 @@ except ImportError:
try:
from coverage import the_coverage as coverage
- def start():
+ def start(threadid=None):
coverage.start()
except ImportError:
# Setting coverage to None will raise errors
@@ -37,7 +42,7 @@ except ImportError:
import warnings
warnings.warn("No code coverage will be performed; coverage.py could not be imported.")
- def start():
+ def start(threadid=None):
pass
# Guess initial depth to hide FIXME this doesn't work for non-cherrypy stuff