Skip to content

Commit

Permalink
run_server fixture: wait for killed process
Browse files Browse the repository at this point in the history
  • Loading branch information
gsakkis authored and cofin committed Oct 29, 2024
1 parent 9abc272 commit af78e6c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/e2e/test_routing/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import subprocess
import time
from pathlib import Path
from typing import Callable, List
Expand All @@ -16,16 +15,13 @@ def runner(app: str, server_command: List[str]) -> None:
tmp_path.joinpath("app.py").write_text(app)
monkeypatch.chdir(tmp_path)

proc = psutil.Popen(
server_command,
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
)
proc = psutil.Popen(server_command)

def kill() -> None:
for child in proc.children(recursive=True):
child.kill()
proc.kill()
proc.wait()

request.addfinalizer(kill)

Expand Down

0 comments on commit af78e6c

Please sign in to comment.