nose-devs/nose — pull request #854 by matthewstory (2014-10-30 21:15:35+00:00)
Title: Allow attribute plugin to select for match on method or class

For non `bool` attributes, it's desirable to combine attributes specified at the class level and the method level, rather than to treat the method attribute as an override to the class attribute. For instance, we use attribute tagging to relate tests back to issues in Jira, and you frequently find yourself in a situation where you want to do something like this:

from nose.plugins.attrib import attr

@attr(issue="#123")
class TestFeatureFoo(object):
def test__core_feature(self):
pass

@attr(issue="#789")
def test__bug_789(self):
pass

With these tests, I would like the test runner:

nosetests -a issue=#123

To pick up both tests, but as currently implemented, only `test__core_feature` would be run. With this patch the same test runner would pick up both `test__core_feature` and `test__bug_789`, which is preferable.