Unittest - default to not merging stdout/stderr during tests

* Tests will now check that stderr is used for errors
* Tests were adjusted to reflect the API change
This commit is contained in:
Renato Alves 2014-10-20 14:01:21 +01:00
parent c9102fd79c
commit efdb31fb90
4 changed files with 22 additions and 18 deletions

View file

@ -3,11 +3,12 @@ import signal
class CommandError(Exception):
def __init__(self, cmd, code, out, err, msg=None):
def __init__(self, cmd, code, out, err=None, msg=None):
if msg is None:
msg_suffix = (
"\n*** Start STDOUT ***\n{2}\n*** End STDOUT ***\n"
"\n*** Start STDERR ***\n{3}\n*** End STDERR ***\n"
msg_suffix = "\n*** Start STDOUT ***\n{2}\n*** End STDOUT ***\n"
if err is not None:
msg_suffix += (
"\n*** Start STDERR ***\n{3}\n*** End STDERR ***\n"
)
if code == -signal.SIGABRT:
self.msg = ("Command '{0}' was aborted, likely due to not "