Skip to content

Instantly share code, notes, and snippets.

@AeroNotix
Created February 9, 2014 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AeroNotix/db274b8e6863a412de0a to your computer and use it in GitHub Desktop.
Save AeroNotix/db274b8e6863a412de0a to your computer and use it in GitHub Desktop.
import sys
import subprocess
import signal
from wait_for import get
import psutil
def kill_proc_tree(pid, including_parent=True):
parent = psutil.Process(pid)
for child in parent.get_children(recursive=True):
child.kill()
if including_parent:
parent.kill()
server = subprocess.Popen(["lein", "run", "--", "--config", "resources/test-config.yaml"])
get("http://localhost:9998/", 60, status_code=401)
p = subprocess.call(["./bin/nosetests","test/acceptance/payments.py"])
kill_proc_tree(server.pid)
sys.exit(p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment