Skip to content

Commit 5dfb940

Browse files
committed
fix test/conftest.py
1 parent dd0b443 commit 5dfb940

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/conftest.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,12 @@ def pytest_sessionfinish(session: Session, exitstatus: ExitCode) -> None:
146146

147147
# https://stackoverflow.com/questions/57336095/access-verbosity-level-in-a-pytest-helper-function
148148
if session.config.getoption("verbose") > 0:
149-
print(child, child.cmdline())
149+
try:
150+
print(child, child.cmdline())
151+
except psutil.NoSuchProcess:
152+
print(f"[WARN] Process {child.pid} no longer exists.")
153+
except Exception as e:
154+
print((f"[ERROR] Failed to get cmdline for {child}: {e}"))
150155

151156
# https://psutil.readthedocs.io/en/latest/#kill-process-tree
152157
try:

0 commit comments

Comments
 (0)