def test_start_logging(fake_proc, caplog):
 cmd = 'does_not_exist'
 args = ['arg', 'arg with spaces']
 with caplog.at_level(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_start_logging ( fake_proc , caplog ) : cmd = 'does_not_exist' args = [ 'arg' , 'arg with spaces' ] with caplog . at_level ( 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'" ] )
make sure that starting logs the executed commandline .