summaryrefslogtreecommitdiff
path: root/selftest/subunithelper.py
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-04-27 12:50:36 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-04-27 14:51:05 +0200
commit0cb0427f134c8fdd79880642abef0ad1f115c3b3 (patch)
treeb85988945b8ca31237c62370070f4f3c8de615fd /selftest/subunithelper.py
parent67a851a05074d2ffd72d54a482a72859e8377b2f (diff)
downloadsamba-0cb0427f134c8fdd79880642abef0ad1f115c3b3.tar.gz
selftest: Place the test environment at the end of the failure lines
This allows a knownfail entry to be added for only one environment, rather than all environments. Andrew Bartlett
Diffstat (limited to 'selftest/subunithelper.py')
-rw-r--r--selftest/subunithelper.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/selftest/subunithelper.py b/selftest/subunithelper.py
index b498878c59a..057e1390508 100644
--- a/selftest/subunithelper.py
+++ b/selftest/subunithelper.py
@@ -270,10 +270,14 @@ class FilterOps(testtools.testresult.TestResult):
self._ops.startTest(test)
def _add_prefix(self, test):
+ prefix = ""
+ suffix = ""
if self.prefix is not None:
- return subunit.RemotedTestCase(self.prefix + test.id())
- else:
- return test
+ prefix = self.prefix
+ if self.suffix is not None:
+ suffix = self.suffix
+
+ return subunit.RemotedTestCase(prefix + test.id() + suffix)
def addError(self, test, details=None):
test = self._add_prefix(test)
@@ -378,13 +382,14 @@ class FilterOps(testtools.testresult.TestResult):
self._ops.end_testsuite(name, result, reason)
- def __init__(self, out, prefix=None, expected_failures=None,
+ def __init__(self, out, prefix=None, suffix=None, expected_failures=None,
strip_ok_output=False, fail_immediately=False,
flapping=None):
self._ops = out
self.seen_output = False
self.output = None
self.prefix = prefix
+ self.suffix = suffix
if expected_failures is not None:
self.expected_failures = expected_failures
else: