diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-09-13 21:42:32 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-09-14 10:54:27 +0200 |
commit | 881f610f06fc644bbbd146d939be5cd1adc19a73 (patch) | |
tree | e3e70188906faccbbd1f03d2d606f4ec539b6e15 | |
parent | 1626dc2bc95ef1c17221ba1a6404a72e21fcfc5b (diff) | |
download | samba-881f610f06fc644bbbd146d939be5cd1adc19a73.tar.gz samba-881f610f06fc644bbbd146d939be5cd1adc19a73.tar.bz2 samba-881f610f06fc644bbbd146d939be5cd1adc19a73.zip |
subunit: Pass TestCase objects to startTest rather than test name strings.
-rwxr-xr-x | selftest/format-subunit | 2 | ||||
-rw-r--r-- | selftest/subunithelper.py | 11 |
2 files changed, 5 insertions, 8 deletions
diff --git a/selftest/format-subunit b/selftest/format-subunit index 25cc206fef..b949d8e9aa 100755 --- a/selftest/format-subunit +++ b/selftest/format-subunit @@ -122,7 +122,7 @@ class PlainFormatter(subunithelper.TestsuiteEnabledTestResult): sys.stdout.write(out) - def startTest(self, testname): + def startTest(self, test): pass def end_test(self, testname, result, unexpected, reason=None): diff --git a/selftest/subunithelper.py b/selftest/subunithelper.py index 255595da45..3328741246 100644 --- a/selftest/subunithelper.py +++ b/selftest/subunithelper.py @@ -47,7 +47,7 @@ def parse_results(msg_ops, statistics, fh): arg = parts[1] if command in ("test", "testing"): msg_ops.control_msg(l) - msg_ops.startTest(arg.rstrip()) + msg_ops.startTest(subunit.RemotedTestCase(arg.rstrip())) open_tests.append(arg.rstrip()) elif command == "time": msg_ops.control_msg(l) @@ -171,9 +171,6 @@ def parse_results(msg_ops, statistics, fh): class SubunitOps(subunit.TestProtocolClient,TestsuiteEnabledTestResult): - def startTest(self, testname): - self._stream.write("test: %s\n" % testname) - def end_test(self, name, result, reason=None): if reason: self._stream.write("%s: %s [\n%s\n]\n" % (result, name, reason)) @@ -253,14 +250,14 @@ class FilterOps(testtools.testresult.TestResult): else: self.output+=msg - def startTest(self, testname): + def startTest(self, test): if self.prefix is not None: - testname = self.prefix + testname + test = subunit.RemotedTestCase(self.prefix + test.id()) if self.strip_ok_output: self.output = "" - self._ops.startTest(testname) + self._ops.startTest(test) def end_test(self, testname, result, unexpected, reason): if self.prefix is not None: |