-
-
Save AeroNotix/db274b8e6863a412de0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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