tweak tests/error output

This commit is contained in:
meejah 2018-12-07 15:57:21 -07:00
parent 7f195c9c9a
commit 3c679e9202
2 changed files with 11 additions and 4 deletions

View File

@ -166,6 +166,7 @@ def test_reject_storage_server(reactor, request, alice, storage_nodes):
) )
assert False, "Should get a failure" assert False, "Should get a failure"
except Exception as e: except Exception as e:
# XXX but how to tell if we failed for the right reason? # depending on the full output being in the error-message
# (should get UploadUnhappinessError) # here; see util.py
print("failure expected: {}".format(e)) assert 'UploadUnhappinessError' in str(e)
print("found expected UploadUnhappinessError")

View File

@ -53,7 +53,13 @@ class _CollectOutputProtocol(ProcessProtocol):
def processExited(self, reason): def processExited(self, reason):
if not isinstance(reason.value, ProcessDone): if not isinstance(reason.value, ProcessDone):
self.done.errback(reason) #self.done.errback(reason)
self.done.errback(RuntimeError(
"Process failed: {}\nOutput:\n{}".format(
reason,
self.output.getvalue(),
)
))
def outReceived(self, data): def outReceived(self, data):
self.output.write(data) self.output.write(data)