Skip to content

fix: keep local coverage central without xdist workers - #764

Merged
ionelmc merged 1 commit into
pytest-dev:masterfrom
Samuel-Hills:fix/dist-without-workers-central
Oct 18, 2026
Merged

ionelmc merged 1 commit into
pytest-dev:masterfrom
Samuel-Hills:fix/dist-without-workers-central

Conversation

@Samuel-Hills

Copy link
Copy Markdown
Contributor

Summary

Fixes coverage setup when --dist is configured without any xdist execution
environments.

Previously, pytest-cov selected the distributed controller whenever --dist
was non-default, even when tests still ran in the current process. This
prevented subprocess coverage setup.

Changes

  • Select the distributed controller only when xdist has workers or execution
    environments.
  • Preserve existing behavior for -n and --tx runs.
  • Add regression coverage for bare --dist.

Validation

  • Full test suite: 204 passed, 6 skipped
  • Ruff check: passed
  • git diff --check: passed

Fixes #667.

@ionelmc
ionelmc merged commit 5389fea into pytest-dev:master Oct 18, 2026
31 of 34 checks passed
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.

Subprocess coverage not set up correctly with xdist when passing --dist but not --numprocesses

2 participants