summaryrefslogtreecommitdiff
path: root/coverage/plugin.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2019-11-15 07:39:43 -0500
committerNed Batchelder <ned@nedbatchelder.com>2019-11-15 07:39:43 -0500
commit21461cde236b8d3c33661295183253d47447ebdb (patch)
tree1469653d5fb69f22133afed566014e202544e38d /coverage/plugin.py
parent8deaa090297bf378a1738d64002163246e84d913 (diff)
downloadpython-coveragepy-git-21461cde236b8d3c33661295183253d47447ebdb.tar.gz
Make howitworks current
Diffstat (limited to 'coverage/plugin.py')
-rw-r--r--coverage/plugin.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/coverage/plugin.py b/coverage/plugin.py
index 5f66dfb9..b9cb7238 100644
--- a/coverage/plugin.py
+++ b/coverage/plugin.py
@@ -57,6 +57,8 @@ attributes whose names start with ``_coverage_``. Don't be startled.
your importable Python package.
+.. _file_tracer_plugins:
+
File Tracers
============
@@ -69,6 +71,8 @@ In your ``coverage_init`` function, use the ``add_file_tracer`` method to
register your file tracer.
+.. _configurer_plugins:
+
Configurers
===========
@@ -81,6 +85,7 @@ change the configuration.
In your ``coverage_init`` function, use the ``add_configurer`` method to
register your configurer.
+
.. _dynamic_context_plugins:
Dynamic Context Switchers
@@ -121,13 +126,14 @@ class CoveragePlugin(object):
Every Python source file is offered to your plug-in to give it a chance
to take responsibility for tracing the file. If your plug-in can
- handle the file, then return a :class:`FileTracer` object. Otherwise
- return None.
+ handle the file, it should return a :class:`FileTracer` object.
+ Otherwise return None.
There is no way to register your plug-in for particular files.
- Instead, this method is invoked for all files, and the plug-in decides
- whether it can trace the file or not. Be prepared for `filename` to
- refer to all kinds of files that have nothing to do with your plug-in.
+ Instead, this method is invoked for all files as they are executed,
+ and the plug-in decides whether it can trace the file or not.
+ Be prepared for `filename` to refer to all kinds of files that have
+ nothing to do with your plug-in.
The file name will be a Python file being executed. There are two
broad categories of behavior for a plug-in, depending on the kind of