summaryrefslogtreecommitdiff
path: root/python/subunit/test_results.py
diff options
context:
space:
mode:
authorJonathan Lange <jml@mumak.net>2012-04-20 17:18:26 +0100
committerJonathan Lange <jml@mumak.net>2012-04-20 17:18:26 +0100
commit16cedbf9742761138fde9be482a118550a69dd1b (patch)
tree5960d7c65ef808ab0202ee9fd9ff59869602de79 /python/subunit/test_results.py
parent72054b561629ef3bb03faff0b28bcb9ad4c787c3 (diff)
downloadsubunit-git-16cedbf9742761138fde9be482a118550a69dd1b.tar.gz
Use the TagsMixin on the predicate so local and global tags are tracked correctly.
Diffstat (limited to 'python/subunit/test_results.py')
-rw-r--r--python/subunit/test_results.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/python/subunit/test_results.py b/python/subunit/test_results.py
index 7cce660..59477f9 100644
--- a/python/subunit/test_results.py
+++ b/python/subunit/test_results.py
@@ -325,14 +325,14 @@ def _make_tag_filter(with_tags, without_tags):
return check_tags
-class _PredicateFilter(TestResultDecorator):
+class _PredicateFilter(TestResultDecorator, TagsMixin):
def __init__(self, result, predicate):
super(_PredicateFilter, self).__init__(result)
+ self._clear_tags()
self.decorated = TimeCollapsingDecorator(
TagCollapsingDecorator(self.decorated))
self._predicate = predicate
- self._current_tags = set()
# The current test (for filtering tags)
self._current_test = None
# Has the current test been filtered (for outputting test tags)
@@ -344,7 +344,7 @@ class _PredicateFilter(TestResultDecorator):
# XXX: ExtendedToOriginalDecorator doesn't properly wrap current_tags.
# https://bugs.launchpad.net/testtools/+bug/978027
return self._predicate(
- test, outcome, error, details, self._current_tags)
+ test, outcome, error, details, self._get_active_tags())
def addError(self, test, err=None, details=None):
if (self.filter_predicate(test, 'error', err, details)):
@@ -394,6 +394,7 @@ class _PredicateFilter(TestResultDecorator):
Not directly passed to the client, but used for handling of tags
correctly.
"""
+ TagsMixin.startTest(self, test)
self._current_test = test
self._current_test_filtered = False
self._buffered_calls.append(('startTest', [test], {}))
@@ -411,11 +412,10 @@ class _PredicateFilter(TestResultDecorator):
self._current_test = None
self._current_test_filtered = None
self._buffered_calls = []
+ TagsMixin.stopTest(self, test)
def tags(self, new_tags, gone_tags):
- new_tags, gone_tags = set(new_tags), set(gone_tags)
- self._current_tags.update(new_tags)
- self._current_tags.difference_update(gone_tags)
+ TagsMixin.tags(self, new_tags, gone_tags)
if self._current_test is not None:
self._buffered_calls.append(('tags', [new_tags, gone_tags], {}))
else: