1
from subunit import test_results
3
1
from testtools import TestResult
5
3
from testrepository.utils import timedelta_to_seconds
8
class TestResultFilter(test_results.TestResultFilter):
9
"""Test result filter."""
11
def _get_concrete_result(self):
12
# XXX: This is really crappy. It assumes that the test result we
13
# actually care about is decorated and that we can find our way to the
14
# one we care about. We want to report counts before filtering, so we
15
# should actually use two result objects - one to count and one to
16
# show. Arguably also the testsRun incrementing facility should be in
20
next = getattr(concrete, 'decorated', None)
26
super(TestResultFilter, self)._filtered()
27
concrete = self._get_concrete_result()
28
concrete.testsRun += 1
30
def stopTest(self, test):
31
# Filter out 'time' calls, because we want to forward those events
32
# regardless of whether the test is filtered.
34
# XXX: Should this be pushed into subunit?
36
for method, args, kwargs in self._buffered_calls:
38
self.decorated.time(*args, **kwargs)
40
buffered_calls.append((method, args, kwargs))
41
self._buffered_calls = buffered_calls
42
super(TestResultFilter, self).stopTest(test)
45
6
class SummarizingResult(TestResult):