summaryrefslogtreecommitdiff
path: root/selftest
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-09-13 20:53:54 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-09-14 10:54:26 +0200
commit8530d5afdee8fbc4d87398839d37c503dc05410d (patch)
treebb0b6513326857f34ac85105a25cf0976009ecd7 /selftest
parent4c45e291a77ba300d88ca7a9f3fb3153b6e4b3dc (diff)
downloadsamba-8530d5afdee8fbc4d87398839d37c503dc05410d.tar.gz
samba-8530d5afdee8fbc4d87398839d37c503dc05410d.tar.bz2
samba-8530d5afdee8fbc4d87398839d37c503dc05410d.zip
subunit: Initial work on using the standard TestResult class.
Diffstat (limited to 'selftest')
-rwxr-xr-xselftest/format-subunit7
-rw-r--r--selftest/subunithelper.py3
2 files changed, 6 insertions, 4 deletions
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:
diff --git a/selftest/subunithelper.py b/selftest/subunithelper.py
index f5e07a1d9a..11b581f6f1 100644
--- a/selftest/subunithelper.py
+++ b/selftest/subunithelper.py
@@ -20,6 +20,7 @@ __all__ = ['parse_results']
import re
import sys
import subunit
+import testtools
import time
VALID_RESULTS = ['success', 'successful', 'failure', 'fail', 'skip', 'knownfail', 'error', 'xfail', 'skip-testsuite', 'testsuite-failure', 'testsuite-xfail', 'testsuite-success', 'testsuite-error']
@@ -253,7 +254,7 @@ def find_in_list(regexes, fullname):
return None
-class FilterOps(object):
+class FilterOps(testtools.testresult.TestResult):
def control_msg(self, msg):
pass # We regenerate control messages, so ignore this