summaryrefslogtreecommitdiff
path: root/coverage/plugin_support.py
diff options
context:
space:
mode:
Diffstat (limited to 'coverage/plugin_support.py')
-rw-r--r--coverage/plugin_support.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/coverage/plugin_support.py b/coverage/plugin_support.py
index 0727a3b0..7c25a5f1 100644
--- a/coverage/plugin_support.py
+++ b/coverage/plugin_support.py
@@ -21,6 +21,7 @@ class Plugins(object):
self.names = {}
self.file_tracers = []
self.configurers = []
+ self.context_switchers = []
self.current_module = None
self.debug = None
@@ -70,6 +71,15 @@ class Plugins(object):
"""
self._add_plugin(plugin, self.configurers)
+ def add_dynamic_context(self, plugin):
+ """Add a dynamic context plugin.
+
+ `plugin` is an instance of a third-party plugin class. It must
+ implement the :meth:`CoveragePlugin.dynamic_context` method.
+
+ """
+ self._add_plugin(plugin, self.context_switchers)
+
def add_noop(self, plugin):
"""Add a plugin that does nothing.