diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-03-31 03:34:50 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-03-31 03:34:50 +0200 |
commit | 62ed8a68cd30037f73536c32c7293bc9a3ab88d4 (patch) | |
tree | 94b5d8bf1a20d86d1b559dbcc76fe03be274f0df /selftest/format-subunit | |
parent | 49d82aa7729c5bfa7dde313580630a5ff97fc05a (diff) | |
download | samba-62ed8a68cd30037f73536c32c7293bc9a3ab88d4.tar.gz samba-62ed8a68cd30037f73536c32c7293bc9a3ab88d4.tar.bz2 samba-62ed8a68cd30037f73536c32c7293bc9a3ab88d4.zip |
format-subunit: Hide reason if it is None.
Diffstat (limited to 'selftest/format-subunit')
-rwxr-xr-x | selftest/format-subunit | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/selftest/format-subunit b/selftest/format-subunit index 325741cfd7..4e02f0f5d5 100755 --- a/selftest/format-subunit +++ b/selftest/format-subunit @@ -89,9 +89,9 @@ class PlainFormatter(object): if result in ("success", "xfail"): self.suites_ok+=1 else: - self.output_msg("ERROR: Testsuite[%s]\n") + self.output_msg("ERROR: Testsuite[%s]\n" % name) if reason is not None: - self.output_msg("REASON: %s\n" % (name, reason or '')) + self.output_msg("REASON: %s\n" % (reason,)) self.suitesfailed.append(name) if self.immediate and not self.verbose: out += self.test_output[name] @@ -108,7 +108,7 @@ class PlainFormatter(object): def start_test(self, testname): pass - def end_test(self, testname, result, unexpected, reason): + def end_test(self, testname, result, unexpected, reason=None): if not unexpected: self.test_output[self.name] = "" if not self.immediate: @@ -119,11 +119,9 @@ class PlainFormatter(object): 'success': '.'}.get(result, "?(%s)" % result)) return - if reason is None: - reason = '' - reason = reason.strip() - - self.test_output[self.name] += "UNEXPECTED(%s): %s\nREASON: %s\n" % (result, testname, reason) + self.test_output[self.name] += "UNEXPECTED(%s): %s\n" % (result, testname) + if reason is not None: + self.test_output[self.name] += "REASON: %s\n" % (reason.strip(),) if self.immediate and not self.verbose: print self.test_output[self.name] |