Skip to content

test: cover fork_context() darwin/win32 branch (no start-method fix at import) - #1662

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/fork-context-darwin-test
Oct 7, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/fork-context-darwin-test

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Adds regression tests for the macOS/Windows branch of fork_context() fixed by community PR #1657 (discussion https://github.com/orgs/PyAutoLabs/discussions/27). Ubuntu CI never reaches that branch, so the tests monkeypatch sys.platform (darwin, and win32 with get_all_start_methods patched to ["spawn"]) and assert:

  • fork_context() returns the multiprocessing module itself, exposing Process, Queue, Pool;
  • a spy on multiprocessing.get_context sees no no-argument call on that path — the import-time call that fixed the default start method and made a later set_start_method(...) raise "context has already been set".

The existing Linux get_context("fork") assertions are unchanged. monkeypatch restores all state, so conftest's start-method setting is unaffected.

Closes #1661.

API Changes

None — test-only change.
See full details below.

Test Plan

  • python -m pytest test_autofit/non_linear/test_fork_context.py -q — 8 passed
  • Witness: with context.py's final line reverted to return multiprocessing.get_context(), the 4 new tests fail; restored, all 8 pass
  • Full test_autofit suite — 2965 passed, 2 skipped (8 min)

Heart readiness at ship: YELLOW (release validation stale; manifest drift; Hands "PyAuto Release" and Heart "Workspace Smoke" red) — acknowledged by the human for development PRs.

Full API Changes (for automation & release notes)

Removed

  • None

Added

  • None (tests only)

Migration

  • None

Generated by the PyAutoLabs agent workflow.

🤖 Generated with Claude Code

…t import)

Monkeypatch sys.platform to darwin/win32 and assert fork_context()
returns the multiprocessing module (Process/Queue/Pool) and never calls
multiprocessing.get_context() with no argument, the import-time call
that fixed the default start method before #1657.

Closes #1661

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Oct 7, 2026
@Jammy2211
Jammy2211 merged commit 1e58fb1 into main Oct 7, 2026
3 checks passed
@Jammy2211
Jammy2211 deleted the feature/fork-context-darwin-test branch October 7, 2026 07:54
@Jammy2211 Jammy2211 removed the pending-release PR queued for the next release build label Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: cover fork_context() darwin/win32 branch (no start-method fix at import)

1 participant