summaryrefslogtreecommitdiff
path: root/nose
diff options
context:
space:
mode:
authorBrendan McCollam <bmccollam@leapfrogonline.com>2011-11-10 12:00:22 -0600
committerBrendan McCollam <bmccollam@leapfrogonline.com>2011-11-10 12:00:22 -0600
commit266d46b59477dcfab06b3d13c83b91cac3417015 (patch)
treeebc97b9488c7f643c8fd21e66151148c8cce412b /nose
parent43b6ada7c7ab612ffaef223affe3e66ff14a09fa (diff)
downloadnose-266d46b59477dcfab06b3d13c83b91cac3417015.tar.gz
Improved handling of addplugins keyword
Diffstat (limited to 'nose')
-rw-r--r--nose/core.py2
-rw-r--r--nose/plugins/manager.py11
2 files changed, 10 insertions, 3 deletions
diff --git a/nose/core.py b/nose/core.py
index 99b3e90..36d966d 100644
--- a/nose/core.py
+++ b/nose/core.py
@@ -104,7 +104,7 @@ class TestProgram(unittest.TestProgram):
if config is None:
config = self.makeConfig(env, plugins)
if addplugins:
- ExtraPluginManager.extraplugins = addplugins
+ config.plugins.addPlugins(extraplugins=addplugins)
self.config = config
self.suite = suite
self.exit = exit
diff --git a/nose/plugins/manager.py b/nose/plugins/manager.py
index 5005b40..5f1f1ea 100644
--- a/nose/plugins/manager.py
+++ b/nose/plugins/manager.py
@@ -405,12 +405,19 @@ class BuiltinPluginManager(PluginManager):
super(BuiltinPluginManager, self).loadPlugins()
class ExtraPluginManager(PluginManager):
- extraplugins = []
"""Plugin manager that loads extra plugins specified
with the keyword `addplugins`
"""
+ def __init__(self, plugins=(), proxyClass=None):
+ super(ExtraPluginManager, self).__init__(plugins, proxyClass)
+ self._proxies['_extraplugins'] = ()
+
+ def addPlugins(self, plugins=(), extraplugins=()):
+ self._extraplugins = extraplugins
+ super(ExtraPluginManager, self).addPlugins(plugins)
+
def loadPlugins(self):
- for plug in self.__class__.extraplugins:
+ for plug in self._extraplugins:
self.addPlugin(plug)
super(ExtraPluginManager, self).loadPlugins()