import shlex import subprocess import time processes = [ subprocess.Popen( shlex.split( "./.venv/bin/mololog.serve --host=127.0.0.1 --port=3999 --db=':memory:' --test=3" ) ), subprocess.Popen( shlex.split("./.venv/bin/mololog.test --url=http://localhost:3999") ), ] for process in processes: while True: process.poll() if process.returncode is not None: if process.returncode != 0: exit(process.returncode) break time.sleep(1) print("Test sucess!")