Skip to content

test(context): replace pytest-forked with subprocess-based isolation#296

Merged
Abhijeet Prasad (AbhiPrasad) merged 1 commit intomainfrom
abhi-test-replace-pytest-forked-with-subprocess
Apr 15, 2026
Merged

test(context): replace pytest-forked with subprocess-based isolation#296
Abhijeet Prasad (AbhiPrasad) merged 1 commit intomainfrom
abhi-test-replace-pytest-forked-with-subprocess

Conversation

@AbhiPrasad
Copy link
Copy Markdown
Member

pytest-forked was never installed in nox test sessions (missing from BASE_TEST_DEPS), so the forked mark was unknown on every platform, producing PytestUnknownMarkWarning spam and silently losing the process isolation the context propagation tests rely on. The package is also deprecated and uses os.fork() which is unavailable on Windows.

Replace with subprocess.run-based isolation: each isolated test now spawns a fresh python -c subprocess that sets up fixtures, optionally calls setup_threads(), and runs the scenario function. This works cross-platform, provides true process isolation, and has no new dependencies.

Remove pytest-forked from requirements-dev.txt.

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) force-pushed the abhi-test-replace-pytest-forked-with-subprocess branch from 510873f to 3011beb Compare April 15, 2026 16:58
pytest-forked was never installed in nox test sessions (missing from
BASE_TEST_DEPS), so the forked mark was unknown on every platform,
producing PytestUnknownMarkWarning spam and silently losing the process
isolation the context propagation tests rely on. The package is also
deprecated and uses os.fork() which is unavailable on Windows.

Replace with subprocess.run-based isolation: each isolated test now
spawns a fresh `python -c` subprocess that sets up fixtures, optionally
calls setup_threads(), and runs the scenario function. This works
cross-platform, provides true process isolation, and has no new
dependencies.

Remove pytest-forked from requirements-dev.txt.
@AbhiPrasad Abhijeet Prasad (AbhiPrasad) force-pushed the abhi-test-replace-pytest-forked-with-subprocess branch from 3011beb to 58a4c90 Compare April 15, 2026 18:04
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stamp

@AbhiPrasad Abhijeet Prasad (AbhiPrasad) merged commit 38b6c28 into main Apr 15, 2026
84 checks passed
@AbhiPrasad Abhijeet Prasad (AbhiPrasad) deleted the abhi-test-replace-pytest-forked-with-subprocess branch April 15, 2026 19:12
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.

2 participants