diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2018-01-06 17:06:59 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2018-01-06 17:06:59 -0500 |
commit | 62699a318754c6811622d31cfab195b4dbc3775e (patch) | |
tree | 43771e501b7e5d8c4d9147517c46234726e1fc54 /coverage/plugin_support.py | |
parent | 62a47468147c97379ea106b3f9c994445b4a08a4 (diff) | |
download | python-coveragepy-git-62699a318754c6811622d31cfab195b4dbc3775e.tar.gz |
A new kind of plug-in: configurers. #563
Diffstat (limited to 'coverage/plugin_support.py')
-rw-r--r-- | coverage/plugin_support.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/coverage/plugin_support.py b/coverage/plugin_support.py index 66cc710a..c737a42c 100644 --- a/coverage/plugin_support.py +++ b/coverage/plugin_support.py @@ -20,6 +20,7 @@ class Plugins(object): self.order = [] self.names = {} self.file_tracers = [] + self.configurers = [] self.current_module = None self.debug = None @@ -60,6 +61,15 @@ class Plugins(object): """ self._add_plugin(plugin, self.file_tracers) + def add_configurer(self, plugin): + """Add a configuring plugin. + + `plugin` is an instance of a third-party plugin class. It must + implement the :meth:`CoveragePlugin.configure` method. + + """ + self._add_plugin(plugin, self.configurers) + def add_noop(self, plugin): """Add a plugin that does nothing. |