summaryrefslogtreecommitdiff
path: root/python/subunit/test_results.py
diff options
context:
space:
mode:
authorJonathan Lange <jml@canonical.com>2011-02-13 14:48:21 +0000
committerJonathan Lange <jml@canonical.com>2011-02-13 14:48:21 +0000
commitd86c97154604bd029774d8095b394de26af4867c (patch)
tree7047f102cc080ed6f5a138e4d8f91e4f0a144332 /python/subunit/test_results.py
parent7fd32930b2d9bff0c4f8f823a313c03beedce451 (diff)
downloadsubunit-git-d86c97154604bd029774d8095b394de26af4867c.tar.gz
Properly handle multiple events.
Diffstat (limited to 'python/subunit/test_results.py')
-rw-r--r--python/subunit/test_results.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/python/subunit/test_results.py b/python/subunit/test_results.py
index b3228c6..cf051ba 100644
--- a/python/subunit/test_results.py
+++ b/python/subunit/test_results.py
@@ -252,18 +252,22 @@ class TimeCollapsingDecorator(HookedTestResultDecorator):
def __init__(self, decorated):
HookedTestResultDecorator.__init__(self, decorated)
- self._last_time = None
+ self._last_received_time = None
+ self._last_sent_time = None
def _before_event(self):
- self.decorated.time(self._last_time)
- self._last_time = None
+ if self._last_received_time != self._last_sent_time:
+ self.decorated.time(self._last_received_time)
+ self._last_sent_time = self._last_received_time
+ self._last_received_time = None
def time(self, a_time):
# Don't upcall, because we don't want to call _before_event, it's only
# for non-time events.
- if self._last_time is None:
+ if self._last_received_time is None:
self.decorated.time(a_time)
- self._last_time = a_time
+ self._last_sent_time = a_time
+ self._last_received_time = a_time
def all_true(bools):