summaryrefslogtreecommitdiff
path: root/functional_tests/test_defaultpluginmanager.py
blob: 28c1b8613648b8614b901ff07e4ff51e563c2728 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import unittest
from nose.plugins import Plugin
from nose.plugins.manager import DefaultPluginManager

class OverridesSkip(Plugin):
    """Plugin to override the built-in Skip"""
    enabled = True
    name = 'skip'
    is_overridden = True


class TestDefaultPluginManager(unittest.TestCase):

    def test_extraplugins_override_builtins(self):
        pm = DefaultPluginManager()
        pm.addPlugins(extraplugins=[OverridesSkip()])
        pm.loadPlugins()
        for plugin in pm.plugins:
            if plugin.name == "skip":
                break
        overridden = getattr(plugin, 'is_overridden', False)
        self.assertTrue(overridden)