summaryrefslogtreecommitdiff
path: root/selftest
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-10-02 18:41:14 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-10-02 18:41:14 +0200
commit72119de02b61f567781ecaab7cfe5f48ac15113a (patch)
tree465f895a4059dd12eebdafb0962efeaa05c22440 /selftest
parentd7edb40fca382ec822a7b17e4b47ecabb43e99d6 (diff)
downloadsamba-72119de02b61f567781ecaab7cfe5f48ac15113a.tar.gz
samba-72119de02b61f567781ecaab7cfe5f48ac15113a.tar.bz2
samba-72119de02b61f567781ecaab7cfe5f48ac15113a.zip
subunithelper: Make filter options optional.
Diffstat (limited to 'selftest')
-rw-r--r--selftest/subunithelper.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/selftest/subunithelper.py b/selftest/subunithelper.py
index bd8cc0f013..e60c8d340c 100644
--- a/selftest/subunithelper.py
+++ b/selftest/subunithelper.py
@@ -338,11 +338,15 @@ class FilterOps(testtools.testresult.TestResult):
self._ops.end_testsuite(name, result, reason)
- def __init__(self, out, prefix, expected_failures, strip_ok_output, fail_immediately=False):
+ def __init__(self, out, prefix=None, expected_failures=None,
+ strip_ok_output=False, fail_immediately=False):
self._ops = out
self.output = None
self.prefix = prefix
- self.expected_failures = expected_failures
+ if expected_failures is not None:
+ self.expected_failures = expected_failures
+ else:
+ self.expected_failures = {}
self.strip_ok_output = strip_ok_output
self.xfail_added = 0
self.fail_added = 0
@@ -355,7 +359,7 @@ class FilterOps(testtools.testresult.TestResult):
class PlainFormatter(TestsuiteEnabledTestResult):
- def __init__(self, summaryfile, verbose, immediate, statistics,
+ def __init__(self, verbose, immediate, statistics,
totaltests=None):
super(PlainFormatter, self).__init__()
self.verbose = verbose
@@ -366,7 +370,6 @@ class PlainFormatter(TestsuiteEnabledTestResult):
self.suitesfailed = []
self.suites_ok = 0
self.skips = {}
- self.summaryfile = summaryfile
self.index = 0
self.name = None
self._progress_level = 0
@@ -504,8 +507,8 @@ class PlainFormatter(TestsuiteEnabledTestResult):
'failure': 'F',
'success': 'S'}.get(result, "?"))
- def summary(self):
- f = open(self.summaryfile, 'w+')
+ def write_summary(self, path):
+ f = open(path, 'w+')
if self.suitesfailed:
f.write("= Failed tests =\n")
@@ -533,9 +536,6 @@ class PlainFormatter(TestsuiteEnabledTestResult):
f.write("\n")
f.close()
- print "\nA summary with detailed information can be found in:"
- print " %s" % self.summaryfile
-
if (not self.suitesfailed and
not self.statistics['TESTS_UNEXPECTED_FAIL'] and
not self.statistics['TESTS_ERROR']):