Skip to content

build(test): add pytest-cov for xdist-compatible coverage#1219

Merged
mergify[bot] merged 1 commit into
python-wheel-build:mainfrom
tiran:add-pytest-cov-xdist
Jun 25, 2026
Merged

build(test): add pytest-cov for xdist-compatible coverage#1219
mergify[bot] merged 1 commit into
python-wheel-build:mainfrom
tiran:add-pytest-cov-xdist

Conversation

@tiran

@tiran tiran commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Pull Request Description

What

coverage run only instruments the main process. With pytest-xdist, test workers are spawned as separate processes and their coverage is lost. Replace coverage run -m pytest with pytest --cov, which uses pytest-cov to instrument xdist workers correctly.

Why

Follow-up to #1218

`coverage run` only instruments the main process. With pytest-xdist,
test workers are spawned as separate processes and their coverage is
lost. Replace `coverage run -m pytest` with `pytest --cov`, which
uses pytest-cov to instrument xdist workers correctly.

Follow-up to python-wheel-build#1218.

Co-Authored-By: Claude <claude@anthropic.com>
Signed-off-by: Christian Heimes <cheimes@redhat.com>
@tiran tiran requested a review from a team as a code owner June 25, 2026 13:45
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f8c385f2-1430-4d34-ac51-6508914574dd

📥 Commits

Reviewing files that changed from the base of the PR and between dbe3a48 and 7bfd36d.

📒 Files selected for processing (1)
  • pyproject.toml

📝 Walkthrough

Walkthrough

pyproject.toml updates the test extras to include pytest-cov and changes the Hatch test script to run python -m pytest with coverage and debug logging options.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: adding pytest-cov for xdist-compatible coverage.
Description check ✅ Passed The description matches the change and explains why pytest-cov replaces coverage run for xdist workers.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify mergify Bot added the ci label Jun 25, 2026

@rd4398 rd4398 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.

LGTM!

@mergify

mergify Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@mergify mergify Bot merged commit 472f516 into python-wheel-build:main Jun 25, 2026
38 of 39 checks passed
@tiran tiran deleted the add-pytest-cov-xdist branch June 25, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants