From db260dc3feb931947309e88fa93063a0a37b6eda Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 6 Jan 2018 17:06:59 -0500 Subject: A new kind of plug-in: configurers. #563 --- coverage/plugin_support.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'coverage/plugin_support.py') 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. -- cgit v1.2.1