Skip to content

Commit 3ecf55d

Browse files
committed
Add minimal test_spawned_process_runner.py as generated by ChatGPT
1 parent 4719b22 commit 3ecf55d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2025 NVIDIA Corporation. All rights reserved.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
4+
# Note: This only covers what is not covered already in test_path_finder_load.py
5+
6+
import pytest
7+
from spawned_process_runner import run_in_spawned_child_process
8+
9+
10+
def child_crashes():
11+
raise RuntimeError("this is an intentional failure")
12+
13+
14+
def test_rethrow_child_exception():
15+
with pytest.raises(ChildProcessError) as excinfo:
16+
run_in_spawned_child_process(child_crashes, rethrow=True)
17+
18+
msg = str(excinfo.value)
19+
assert "Child process exited with code 1" in msg
20+
assert "this is an intentional failure" in msg
21+
assert "--- stderr-from-child-process ---" in msg

0 commit comments

Comments
 (0)