Skip to content

Docs: explain parametrization requirements with pytest-xdist - #15063

Open
LaTranquillum wants to merge 2 commits into
pytest-dev:mainfrom
LaTranquillum:docs-4101-xdist-parametrization
Open

LaTranquillum wants to merge 2 commits into
pytest-dev:mainfrom
LaTranquillum:docs-4101-xdist-parametrization

Conversation

@LaTranquillum

Copy link
Copy Markdown

Parallel workers can collect different test IDs or collect them in a different order when parameters come from unordered inputs or values generated during collection. The parametrization how-to now explains the resulting collection error, shows a sorted-parameter example, and distinguishes stable IDs from consistent test cases. It links to pytest-xdist’s collection guidance and includes a changelog entry.

Closes #4101.

Validation on macOS:

  • Reproduced the collection mismatch by reversing parameter order in one of two workers.
  • Sorting those inputs passed both parametrized cases; the exact documented example also passed both cases (pytest 9.1.1, pytest-xdist 3.8.0, CPython 3.14.2).
  • Full Sphinx HTML build passed with -W --keep-going after correcting a heading underline.
  • blacken-docs --check and codespell passed for both changed files.

No runtime code changed; the full pytest test suite and full pre-commit suite were not run. Maintainer edits are enabled.

AI assistance: Codex drafted the patch and ran the checks. I reviewed the patch and explanation and authorized this submission.

@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update docs on parametrization gotchas

1 participant