Skip to content

Use pytest-xdist with one group and two workers#1243

Merged
krmax44 merged 3 commits intomainfrom
stefanw/pytest-xdist-grouped
Apr 16, 2026
Merged

Use pytest-xdist with one group and two workers#1243
krmax44 merged 3 commits intomainfrom
stefanw/pytest-xdist-grouped

Conversation

@stefanw
Copy link
Copy Markdown
Member

@stefanw stefanw commented Apr 13, 2026

Tests that need elasticsearch or playwright are grouped into one worker to run sequentially.

@stefanw stefanw force-pushed the stefanw/pytest-xdist-grouped branch 3 times, most recently from 3ac0161 to 4cdcf2b Compare April 13, 2026 08:41
Tests that need elasticsearch or playwright are grouped into one worker to run sequentially
@stefanw stefanw force-pushed the stefanw/pytest-xdist-grouped branch from 4cdcf2b to e9d9320 Compare April 13, 2026 08:49
@stefanw stefanw requested a review from krmax44 April 13, 2026 09:15
@krmax44
Copy link
Copy Markdown
Member

krmax44 commented Apr 16, 2026

Great! I tried this approach before too, but seemed to have missed some tests for the sequential group. Seems to work reliably now, also with more than two workers.

Minor things:

  • I removed the -n option from pyproject.toml and set it explicitly in CI (to -n auto), as always running parallelized can cause issues with tools like the pytest debuger within VS Code.
  • I also removed the warning filters. We're currently getting only four unique warnings, at least one of which is useful.
  • I added pytest-cov, which properly reports coverage with parallelized runs (before, CI reported only 16 %).

@krmax44 krmax44 merged commit 5bb6bcc into main Apr 16, 2026
4 checks passed
@krmax44 krmax44 deleted the stefanw/pytest-xdist-grouped branch April 16, 2026 10:22
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.

2 participants