parent
729be7e7cc
commit
d15cc07ed3
@ -125,8 +125,9 @@ class GUIProcess(QObject):
|
||||
raise ValueError("Trying to start a running QProcess!")
|
||||
self.cmd = cmd
|
||||
self.args = args
|
||||
fake_cmdline = ' '.join(shlex.quote(e) for e in [cmd] + list(args))
|
||||
log.procs.debug("Executing: {}".format(fake_cmdline))
|
||||
if self.verbose:
|
||||
fake_cmdline = ' '.join(shlex.quote(e) for e in [cmd] + list(args))
|
||||
message.info(self._win_id, 'Executing: ' + fake_cmdline)
|
||||
|
||||
def start(self, cmd, args, mode=None):
|
||||
|
@ -176,6 +176,17 @@ def test_cmd_args(fake_proc):
|
||||
assert (fake_proc.cmd, fake_proc.args) == (cmd, args)
|
||||
|
||||
|
||||
def test_start_logging(fake_proc, caplog):
|
||||
"""Make sure that starting logs the executed commandline."""
|
||||
cmd = 'does_not_exist'
|
||||
args = ['arg', 'arg with spaces']
|
||||
with caplog.atLevel(logging.DEBUG):
|
||||
fake_proc.start(cmd, args)
|
||||
msgs = [e.msg for e in caplog.records()]
|
||||
assert msgs == ["Starting process.",
|
||||
"Executing: does_not_exist arg 'arg with spaces'"]
|
||||
|
||||
|
||||
def test_error(qtbot, proc, caplog, guiprocess_message_mock):
|
||||
"""Test the process emitting an error."""
|
||||
with caplog.atLevel(logging.ERROR, 'message'):
|
||||
|
Loading…
Reference in New Issue
Block a user