Skip to content

Commit d857e05

Browse files
authored
Merge pull request #196 from am1ter/main
Change fork method in SSE transport tests to avoid pickling issues
2 parents 1710b14 + 2e91b33 commit d857e05

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_sse_real_transport.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,12 @@ def server(request: pytest.FixtureRequest) -> Generator[str, None, None]:
9191
s.bind((HOST, 0))
9292
server_port = s.getsockname()[1]
9393

94+
# Use fork method to avoid pickling issues
95+
ctx = multiprocessing.get_context("fork")
96+
9497
# Run the server in a subprocess
9598
fastapi_app = request.getfixturevalue(request.param)
96-
proc = multiprocessing.Process(
99+
proc = ctx.Process(
97100
target=run_server,
98101
kwargs={"server_port": server_port, "fastapi_app": fastapi_app},
99102
daemon=True,

0 commit comments

Comments
 (0)