Skip to content

forward args to subprocess by default, block explicit unsupported list - #49

Merged
dyollb merged 4 commits into
mainfrom
forward_if_not_blacklisted
Jun 15, 2026
Merged

forward args to subprocess by default, block explicit unsupported list#49
dyollb merged 4 commits into
mainfrom
forward_if_not_blacklisted

Conversation

@dyollb

@dyollb dyollb commented Jun 14, 2026

Copy link
Copy Markdown
Owner

MR Summary

Switched pytest-isolated to a blacklist model for CLI forwarding: options are now forwarded to child subprocesses by default, and only a small explicit set of truly incompatible options is blocked. This improves plugin and custom-option compatibility.

What changed

  • Updated forwarding behavior to “allow by default” with explicit blocklist validation in config.py and orchestration adjustments in execution.py.
  • Kept parent-only handling where appropriate (for options resolved before child execution), with compatibility checks integrated via grouping.py.
  • Added/expanded regression coverage for custom options and key compatibility scenarios in test_options.py and test_execution_units.py.
  • Documented the new compatibility taxonomy:
    • unsupported options
    • supported but parent-handled options
    • forwarded-by-default options
      in incompatible-options.md, plus a high-level note in README.md.

Related

Copilot AI left a comment

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.

Pull request overview

This PR updates pytest-isolated’s subprocess CLI-argument handling to a forward-by-default (blacklist) model, adds early validation for explicitly incompatible options when isolation is active, and documents the option-compatibility behavior with expanded test coverage.

Changes:

  • Switch argument forwarding to a blacklist approach so custom/third-party options are forwarded by default.
  • Add early validation to raise UsageError when isolation is active alongside explicitly incompatible options (including via PYTEST_ADDOPTS).
  • Add tests + documentation for option compatibility/forwarding behavior (including PYTEST_ADDOPTS, -p, --setup-show, and --import-mode).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/test_options.py Adds integration tests for forwarding behavior, env var propagation, and several option compatibility scenarios.
tests/test_execution_units.py Updates unit expectations for _build_forwarded_args to match forward-by-default behavior.
src/pytest_isolated/grouping.py Adds early incompatible-option validation when isolation will be used.
src/pytest_isolated/execution.py Reworks _build_forwarded_args for blacklist forwarding and adds --setup-show output re-emission.
src/pytest_isolated/config.py Introduces _INCOMPATIBLE_OPTIONS and _validate_isolation_compatibility.
README.md Documents the new compatibility model and links to a reference page.
docs/incompatible-options.md New reference documentation describing blocked/parent-handled/forwarded options.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_options.py Outdated
Comment thread tests/test_options.py Outdated
Comment thread src/pytest_isolated/execution.py Outdated
Comment thread src/pytest_isolated/execution.py Outdated
Comment thread src/pytest_isolated/execution.py Outdated
Comment thread src/pytest_isolated/config.py Outdated
Comment thread src/pytest_isolated/config.py Outdated
Comment thread docs/incompatible-options.md
@dyollb
dyollb force-pushed the forward_if_not_blacklisted branch from 92955c3 to d8df6ec Compare June 15, 2026 07:53
@dyollb
dyollb requested a review from pcrespov June 15, 2026 07:57

@pcrespov pcrespov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thx!

Comment thread tests/test_options.py
Comment thread tests/test_options.py
Comment thread tests/test_options.py
@dyollb
dyollb merged commit ed04245 into main Jun 15, 2026
3 checks passed
@dyollb
dyollb deleted the forward_if_not_blacklisted branch June 17, 2026 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants