diff options
author | Brendan McCollam <bmccollam@leapfrogonline.com> | 2011-11-09 16:17:53 -0600 |
---|---|---|
committer | Brendan McCollam <bmccollam@leapfrogonline.com> | 2011-11-09 16:17:53 -0600 |
commit | 43b6ada7c7ab612ffaef223affe3e66ff14a09fa (patch) | |
tree | 103c4a4e5e712a5818d7972b3dc75535ce0e5f62 /functional_tests | |
parent | 0d9a2e01e228b8d143dd2c55da6443f3f533950b (diff) | |
download | nose-43b6ada7c7ab612ffaef223affe3e66ff14a09fa.tar.gz |
Changes to plugins.manager.py to allow plugins included with addplugins keyword to take precedence
Diffstat (limited to 'functional_tests')
-rw-r--r-- | functional_tests/test_defaultpluginmanager.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/functional_tests/test_defaultpluginmanager.py b/functional_tests/test_defaultpluginmanager.py new file mode 100644 index 0000000..2f82737 --- /dev/null +++ b/functional_tests/test_defaultpluginmanager.py @@ -0,0 +1,24 @@ +import unittest +from nose.plugins import Plugin +from nose.plugins.manager import DefaultPluginManager, ExtraPluginManager + +class OverridesSkip(Plugin): + """Plugin to override the built-in Skip""" + enabled = True + name = 'skip' + is_overridden = True + +class TestDefaultPluginManager(unittest.TestCase): + + def setUp(self): + ExtraPluginManager.extraplugins = [OverridesSkip()] + + def test_extraplugins_override_builtins(self): + pm = DefaultPluginManager() + pm.loadPlugins() + skip_plugin = next(p for p in pm.plugins if p.name == "skip") + overridden = getattr(skip_plugin, 'is_overridden', False) + self.assertTrue(overridden) + + def tearDown(self): + ExtraPluginManager.extraplugins = [] |