diff options
author | David Douard <david.douard@logilab.fr> | 2009-10-08 12:40:11 +0200 |
---|---|---|
committer | David Douard <david.douard@logilab.fr> | 2009-10-08 12:40:11 +0200 |
commit | 1c227f7ccb0075d9748f320ebc200ec160858ad6 (patch) | |
tree | d6a3807291a4be4ab9bd053d03aa6197d88d101f | |
parent | a1833732361ed38666b2fcaad4893ab5f6b78ec6 (diff) | |
download | logilab-common-1c227f7ccb0075d9748f320ebc200ec160858ad6.tar.gz |
Make it possible to tag test classes
If a tags is set on both a class and a method of this class, this latter take precedence in tag definition
-rw-r--r-- | testlib.py | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -466,8 +466,13 @@ class SkipAwareTextTestRunner(unittest.TextTestRunner): if self.options is not None: tags_pattern = getattr(self.options, 'tags_pattern', None) if tags_pattern is not None: - tags = getattr(test, 'tags', Tags()) - return tags.match(tags_pattern) + tags = getattr(test, 'tags', None) + if tags is not None: + return tags.match(tags_pattern) + if isinstance(test, types.MethodType): + tags = getattr(test.im_class, 'tags', Tags()) + return tags.match(tags_pattern) + return False return True # no pattern def _makeResult(self): |