Repository navigation
Conversation
RonnyPfannschmidt
left a comment
There was a problem hiding this comment.
🤖 Written by Claude Opus 5.5 via Claude Code for the pytest-xdist maintainers; I prompted it, it did the work, I read it.
LGTM, this matches the scope suggested in #958. I checked it locally with -n2 --no-header. With and without -v, the worker status lines (created:, the per-worker Python/cwd lines, N workers [M items], scheduling tests via ...) are all gone. Test results and node down: errors still show.
One thing we might want to nitpick, now or as a follow-up: N workers [M items] is also xdist's only equivalent of collected N items. Plain pytest keeps that line under --no-header:
$ pytest --no-header
collected 2 items
$ pytest --no-header -n2
(no count at all with this PR)
So -n runs now print less than serial runs. We could keep printing the item count (for example as collected M items once collection is done), or accept dropping it as #958 suggested. I'm fine with either, but we should decide on purpose.
The py311-pytestmain failures are in TestGroupScope, which this PR doesn't touch. I think they come from changes in pytest main.
Generated by Claude Code
Running pytest with
--no-header -n1still prints worker startup/status lines and, with-v, the scheduling banner. Respect--no-headerin the xdist header paths while keeping worker error messages, test results and scheduling intact.Fixes #958, following the scope suggested in #958 (comment). This does not add serial-style collected/deselected counts.
Tests cover TTY and non-TTY reporting, different-interpreter banners, normal header output, worker errors, and one-worker runs at default/quiet/verbose levels with passing, skipped and failing tests. Before the change, five regression cases fail and five controls pass; all ten pass afterward.
Validation on macOS ARM64 with CPython 3.13.9, pytest 8.4.2 and execnet 2.1.2:
test_dsession.py,test_plugin.pyandTestTerminalReporting: 82 passed, one optional-psutil skip and two existing expected failures.The full suite, other interpreter/platform combinations and remaining pre-commit hooks were not run locally.
AI assistance: Codex assisted with the implementation, regression tests, review and this description.
Thanks for submitting a PR, your contribution is really appreciated!
Here's a quick checklist that should be present in PRs:
Make sure to include reasonable tests for your change if necessary
We use towncrier for changelog management, so please add a news file into the
changelogfolder following these guidelines:Name it
$issue_id.$typefor example588.bugfix;If you don't have an issue_id change it to the PR id after creating it
Ensure type is one of
removal,feature,bugfix,vendor,docortrivialMake sure to use full sentences with correct case and punctuation, for example: