Skip to content

test: skip real-transport tests on Windows (they require os.fork) - #332

Open
K4bain wants to merge 1 commit into
tadata-org:mainfrom
K4bain:fix/windows-fork-tests
Open

test: skip real-transport tests on Windows (they require os.fork)#332
K4bain wants to merge 1 commit into
tadata-org:mainfrom
K4bain:fix/windows-fork-tests

Conversation

@K4bain

@K4bain K4bain commented Aug 27, 2026

Copy link
Copy Markdown

The server fixture in both real-transport test modules spawns the FastAPI app in a subprocess via multiprocessing.get_context("fork"):

ctx = multiprocessing.get_context("fork")

os.fork() does not exist on Windows, so every test in test_sse_real_transport.py and test_http_real_transport.py errors with ValueError: cannot find context for 'fork' when the suite is run on Windows (fork was chosen over spawn to avoid pickling the FastAPI app, so there is no drop-in substitute).

This PR adds a module-level pytestmark = pytest.mark.skipif(os.name == "nt", ...) to both modules, with a comment explaining why. Behavior on POSIX (including CI) is unchanged — the tests still run there. Locally on Windows the suite now reports 69 passed, 20 skipped instead of 20 errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant