Merge branch 'develop' of github.com:kgrandis/nose-exclude into develop

This commit is contained in:
Kurt Grandis 2016-09-06 14:00:34 -04:00
commit 86340b2411
2 changed files with 24 additions and 1 deletions

View File

@ -150,7 +150,7 @@ class NoseExclude(Plugin):
try:
cls = get_method_class(meth)
except AttributeError:
return False
return None
fqn = '%s.%s.%s' % (cls.__module__, cls.__name__, meth.__name__)
if fqn in self.exclude_tests:

View File

@ -224,5 +224,28 @@ class TestNoseExcludeTestModule(PluginTester, unittest.TestCase):
def test_tests_excluded(self):
assert 'Ran 3 tests' in self.output
class TestNoseDoesNotExcludeTestClass(PluginTester, unittest.TestCase):
"""Test nose-exclude tests by class"""
activate = "--exclude-test=test_dirs.unittest.test"
plugins = [NoseExclude()]
suitepath = os.path.join(os.getcwd(), 'test_dirs/unittest')
def setUp(self):
def mock_get_method_class(meth):
raise AttributeError('foobar')
import nose_exclude
self.old_get_method_class = nose_exclude.get_method_class
nose_exclude.get_method_class = mock_get_method_class
super(TestNoseDoesNotExcludeTestClass, self).setUp()
def tearDown(self):
import nose_exclude
nose_exclude.get_method_class = self.old_get_method_class
def test_tests_not_excluded(self):
assert 'Ran 3 tests' in self.output
if __name__ == '__main__':
unittest.main()