summaryrefslogtreecommitdiff
path: root/python/subunit/test_results.py
diff options
context:
space:
mode:
authorJonathan Lange <jml@mumak.net>2012-04-20 11:00:14 +0100
committerJonathan Lange <jml@mumak.net>2012-04-20 11:00:14 +0100
commit7ae3b8ff3d861923877a273cf6818eaf86f220e5 (patch)
tree3aabae65e8e63c2c7b37e8e484afd6ecdcab2d50 /python/subunit/test_results.py
parenteff5dc6d9da686ebbb2de9444c5bdc46e5a0539f (diff)
downloadsubunit-git-7ae3b8ff3d861923877a273cf6818eaf86f220e5.tar.gz
Make sure tags directives are sent before addSuccess etc.
Diffstat (limited to 'python/subunit/test_results.py')
-rw-r--r--python/subunit/test_results.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/python/subunit/test_results.py b/python/subunit/test_results.py
index fb7affd..b5ac0f1 100644
--- a/python/subunit/test_results.py
+++ b/python/subunit/test_results.py
@@ -205,7 +205,7 @@ class AutoTimingTestResultDecorator(HookedTestResultDecorator):
return self.decorated.time(a_datetime)
-class TagCollapsingDecorator(TestResultDecorator):
+class TagCollapsingDecorator(HookedTestResultDecorator):
"""Collapses many 'tags' calls into one where possible."""
def __init__(self, result):
@@ -223,16 +223,15 @@ class TagCollapsingDecorator(TestResultDecorator):
self._current_test_tags = set(), set()
def stopTest(self, test):
- """Stop a test.
+ super(TagCollapsingDecorator, self).stopTest(test)
+ self._current_test_tags = None
- Not directly passed to the client, but used for handling of tags
- correctly.
- """
- # Tags to output for this test.
+ def _before_event(self):
+ if not self._current_test_tags:
+ return
if self._current_test_tags[0] or self._current_test_tags[1]:
self.decorated.tags(*self._current_test_tags)
- self.decorated.stopTest(test)
- self._current_test_tags = None
+ self._current_test_tags = set(), set()
def tags(self, new_tags, gone_tags):
"""Handle tag instructions.