nose: nose.plugins.manager
A plugin manager class is used to load plugins, manage the list of loaded plugins, and proxy calls to those plugins.
The plugin managers provided with nose are:
- PluginManager
- This manager doesn't implement loadPlugins, so it can only work with a static list of plugins.
- BuiltinPluginManager
- This manager loads plugins referenced in nose.plugins.builtin.
- EntryPointPluginManager
- This manager uses setuptools entrypoints to load plugins.
- DefaultPluginMananger
- This is the manager class that will be used by default. If setuptools is installed, it is a subclass of EntryPointPluginManager and BuiltinPluginManager; otherwise, an alias to BuiltinPluginManager.
- RestrictedPluginManager
- This manager is for use in test runs where some plugin calls are not available, such as runs started with python setup.py test, where the test runner is the default unittest TextTestRunner. It is a subclass of DefaultPluginManager.
Writing a plugin manager
If you want to load plugins via some other means, you can write a plugin manager and pass an instance of your plugin manager class when instantiating the nose.config.Config instance that you pass to TestProgram (or main or run).
To implement your plugin loading scheme, implement loadPlugins(), and in that method, call addPlugin() with an instance each plugin you wish to make available. Make sure to call super(self).loadPlugins() as well if have subclassed a manager other than PluginManager.
Classes
Highlighted methods are defined in this class.
Methods
Configure the set of plugins with the given options and config instance. After configuration, disabled plugins are removed from the plugins list.
Load plugins in nose.plugins.builtin
Attributes
Default value: (('nose.plugins.0.10', None), ('nose.plugins', <class nose.plugins.manager.ZeroNinePlugin>))
Default value: (property)
Access the list of plugins managed by this plugin manager
Base class for plugin managers. Does not implement loadPlugins, so it may only be used with a static list of plugins.
The basic functionality of a plugin manager is to proxy all unknown attributes through a PluginProxy to a list of plugins.
Note that the list of plugins may not be changed after the first plugin call.
Methods
Configure the set of plugins with the given options and config instance. After configuration, disabled plugins are removed from the plugins list.
Attributes
Default value: (property)
Access the list of plugins managed by this plugin manager
Plugin manager that loads plugins from the nose.plugins and nose.plugins.0.10 entry points.
Methods
Configure the set of plugins with the given options and config instance. After configuration, disabled plugins are removed from the plugins list.
Load plugins by iterating the nose.plugins entry point.
Attributes
Default value: (('nose.plugins.0.10', None), ('nose.plugins', <class nose.plugins.manager.ZeroNinePlugin>))
Default value: (property)
Access the list of plugins managed by this plugin manager
Plugin manager that loads plugins from the list in nose.plugins.builtin.
Methods
Configure the set of plugins with the given options and config instance. After configuration, disabled plugins are removed from the plugins list.
Load plugins in nose.plugins.builtin
Attributes
Default value: (property)
Access the list of plugins managed by this plugin manager
Plugin manager that restricts the plugin list to those not excluded by a list of exclude methods. Any plugin that implements an excluded method will be removed from the manager's plugin list after plugins are loaded.
Methods
Configure the set of plugins with the given options and config instance. After configuration, disabled plugins are removed from the plugins list.
Attributes
Default value: (('nose.plugins.0.10', None), ('nose.plugins', <class nose.plugins.manager.ZeroNinePlugin>))
Default value: (property)
Access the list of plugins managed by this plugin manager
Proxy for plugin calls. Essentially a closure bound to the given call and plugin list.
The plugin proxy also must be bound to a particular plugin interface specification, so that it knows what calls are available and any special handling that is required for each call.
Methods
Chainable but not quite normal. Plugins return a tuple of (tests, names) after processing the names. The tests are added to a suite that is accumulated throughout the full call, while names are input for the next plugin in the chain.
Add plugin to my list of plugins to call, if it has the attribute I'm bound to.
Call plugins in a chain, where the result of each plugin call is sent to the next plugin as input. The final output result is returned.
Call all plugins, yielding each item in each non-None result.
Call all plugins, returning the first non-None result.
Proxy for 0.9 plugins, adapts 0.10 calls to 0.9 standard.