summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.txt3
-rw-r--r--coverage/__init__.py2
-rw-r--r--coverage/control.py11
-rw-r--r--howto.txt2
4 files changed, 13 insertions, 5 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index cdb76a4..e53f202 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -11,6 +11,9 @@ Version 3.3
- Fixed a problem with nested loops having their branch possibilities
mischaracterized: `issue 39`_.
+- Added coverage.process_start to enable coverage measurement when Python
+ starts.
+
- Added an AUTHORS.txt file.
.. _issue 39: http://bitbucket.org/ned/coveragepy/issue/39
diff --git a/coverage/__init__.py b/coverage/__init__.py
index 100e0b7..c48e90e 100644
--- a/coverage/__init__.py
+++ b/coverage/__init__.py
@@ -9,7 +9,7 @@ __version__ = "3.3a1" # see detailed history in CHANGES.txt
__url__ = "http://nedbatchelder.com/code/coverage"
-from coverage.control import coverage, measure_process
+from coverage.control import coverage, process_startup
from coverage.data import CoverageData
from coverage.cmdline import main, CoverageScript
from coverage.misc import CoverageException
diff --git a/coverage/control.py b/coverage/control.py
index 4acef71..415df27 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -373,11 +373,16 @@ class coverage(object):
return info
-def measure_process():
- """Called at Python startup time to perhaps measure coverage.
+def process_startup():
+ """Call this at Python startup to perhaps measure coverage.
+
+ To invoke this when Python starts, you can create a .pth file in your
+ Python installation containing this::
+
+ import coverage; coverage.process_startup()
If the environment variable COVERAGE_PROCESS_START is defined, coverage
- measurement is started, and the value of the variable is the data file
+ measurement is started. The value of the variable is the data file
prefix to use.
"""
diff --git a/howto.txt b/howto.txt
index 54c94a1..96e1e06 100644
--- a/howto.txt
+++ b/howto.txt
@@ -56,4 +56,4 @@
- For complete coverage testing, in each Python installation, create a
"zzz_coverage_process_start.pth" containing::
- import coverage; coverage.measure_process()
+ import coverage; coverage.process_startup()