From 8530d5afdee8fbc4d87398839d37c503dc05410d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 13 Sep 2010 20:53:54 +0200 Subject: subunit: Initial work on using the standard TestResult class. --- selftest/format-subunit | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'selftest/format-subunit') diff --git a/selftest/format-subunit b/selftest/format-subunit index b4509ab1cf..31136b05ff 100755 --- a/selftest/format-subunit +++ b/selftest/format-subunit @@ -14,6 +14,7 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib/testtools")) import subunithelper import subunit +import testtools def format_time(t): minutes, seconds = divmod(t, 60) @@ -27,7 +28,7 @@ def format_time(t): return ret -class PlainFormatter(object): +class PlainFormatter(testtools.testresult.TestResult): def __init__(self, summaryfile, verbose, immediate, statistics, totaltests=None): @@ -69,7 +70,7 @@ class PlainFormatter(object): duration = testsuite_start_time - self.start_time if not self.verbose: - self.test_output[name] = "" + self.test_output[name] = "" out = "[%d" % self.index if self.totalsuites is not None: @@ -77,7 +78,7 @@ class PlainFormatter(object): out += " in " + format_time(duration) if self.suitesfailed: out += ", %d errors" % (len(self.suitesfailed),) - out += "] %s" % name + out += "] %s" % name if self.immediate: sys.stdout.write(out + "\n") else: -- cgit