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 | db260dc3feb931947309e88fa93063a0a37b6eda (patch) | |
tree | 50867f9cd23e2c6196f145eca32e39cd0ffdbe19 /coverage/plugin_support.py | |
parent | 66dc96690399b6db97c638fefa8dcff626844900 (diff) | |
download | python-coveragepy-db260dc3feb931947309e88fa93063a0a37b6eda.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 66cc710..c737a42 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. |