@pytest.mark.parametrize('stream', ['stdout', 'stderr'])
def test_exit_successful_output(qtbot, proc, py_proc, stream):
 with qtbot.waitSignal(proc.finished, timeout=10000):
  proc.start(*py_proc('\n            import sys\n            print("test", file=sys.{})\n            sys.exit(0)\n        '.format(stream)))

@ pytest . mark . parametrize ( 'stream' , [ 'stdout' , 'stderr' ] ) def test_exit_successful_output ( qtbot , proc , py_proc , stream ) : with qtbot . waitSignal ( proc . finished , timeout = 10000 ) : proc . start ( * py_proc ( '\n            import sys\n            print("test", file=sys.{})\n            sys.exit(0)\n        ' . format ( stream ) ) )
when a process succeeds .