def test_start_verbose(proc, qtbot, message_mock, py_proc):
 proc.verbose = True
 with qtbot.waitSignals([proc.started, proc.finished], timeout=10000, order='strict'):
  argv = py_proc("import sys; print('test'); sys.exit(0)")
  proc.start(*argv)
 msgs = message_mock.messages
 assert (msgs[0].level == usertypes.MessageLevel.info)
 assert (msgs[1].level == usertypes.MessageLevel.info)
 assert msgs[0].text.startswith('Executing:')
 assert (msgs[1].text == 'Testprocess exited successfully.')
 assert (bytes(proc._proc.readAll()).rstrip() == 'test')

def test_start_verbose ( proc , qtbot , message_mock , py_proc ) : proc . verbose = True with qtbot . waitSignals ( [ proc . started , proc . finished ] , timeout = 10000 , order = 'strict' ) : argv = py_proc ( "import sys; print('test'); sys.exit(0)" ) proc . start ( * argv ) msgs = message_mock . messages assert ( msgs [ 0 ] . level == usertypes . MessageLevel . info ) assert ( msgs [ 1 ] . level == usertypes . MessageLevel . info ) assert msgs [ 0 ] . text . startswith ( 'Executing:' ) assert ( msgs [ 1 ] . text == 'Testprocess exited successfully.' ) assert ( bytes ( proc . _proc . readAll ( ) ) . rstrip ( ) == 'test' )
test starting a process verbosely .