Skip to content

Fix loadgroup with pytest main node IDs - #1388

Open
itscloud0 wants to merge 3 commits into
pytest-dev:masterfrom
itscloud0:fix-1386-loadgroup-nodeid
Open

itscloud0 wants to merge 3 commits into
pytest-dev:masterfrom
itscloud0:fix-1386-loadgroup-nodeid

Conversation

@itscloud0

Copy link
Copy Markdown

Problem

pytest main uses structured node IDs. --dist=loadgroup still writes the legacy _nodeid field, so grouped tests silently lose their group suffix and are distributed independently.

Solution

Update the structured ID when it is available, while retaining the legacy path for supported older pytest releases.

Verification

  • pytest testing/acceptance_test.py::TestGroupScope -q (6 passed)
  • ruff check --select B010 src/xdist/remote.py
  • ruff format --check src/xdist/remote.py
  • git diff --check

Closes #1386.

@RonnyPfannschmidt

Copy link
Copy Markdown
Member

@nicoddemus i tihnk we need to transfer the groups separately - id was never supposed to be mutated to begin wirth

@itscloud0
itscloud0 force-pushed the fix-1386-loadgroup-nodeid branch from f20f703 to ffa67fe Compare September 22, 2026 17:04
@itscloud0
itscloud0 marked this pull request as ready for review September 23, 2026 06:38

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--dist=loadgroup silently stops grouping on pytest main: the nodeid mutation no longer takes effect

2 participants