Skip to content

Add pytest-xdist to dev-requirements#724

Merged
mhucka merged 2 commits into
masterfrom
mh-add-pytest-xdist
Jun 7, 2025
Merged

Add pytest-xdist to dev-requirements#724
mhucka merged 2 commits into
masterfrom
mh-add-pytest-xdist

Conversation

@mhucka
Copy link
Copy Markdown
Collaborator

@mhucka mhucka commented May 28, 2025

This allows for parallel pytest execution.

(By itself, this addition to dev-requirements.txt does nothing; the purpose is to make it a separate commit so that the xdist features can be used in updated workflows and test scripts.)

This allows parallel `pytest` execution.
@mhucka mhucka requested review from dstrain115 and pavoljuhas May 30, 2025 18:11
Copy link
Copy Markdown
Collaborator

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider if the [psutil] extra is truly needed. IIUC, it only comes into play for --numprocesses=logical option which may not get used at all.

@mhucka
Copy link
Copy Markdown
Collaborator Author

mhucka commented May 31, 2025

Consider if the [psutil] extra is truly needed. IIUC, it only comes into play for --numprocesses=logical option which may not get used at all.

Huh. I was going by the explanation in the installation instructions, which state:

To use psutil for detection of the number of CPUs available, install the psutil extra:
pip install pytest-xdist[psutil]

Looking at the code, it looks like it defaults to using psutil.cpu_count() if another flag is not given; i.e., the addition is not purely for logical cpu counts.

However, the rest of the function around that line tries a bunch of other approaches if it doesn't have psutil. Thus, there doesn't seem to be a strong reason to include psutil after all, and I agree with you that it can be removed.

Commit 8be2e8a removes it.

@pavoljuhas rightly noted that `psutil` is not really needed.

C.f. review comment #724 (comment)
@mhucka mhucka self-assigned this May 31, 2025
@mhucka mhucka merged commit 5d8e38e into master Jun 7, 2025
14 of 19 checks passed
@mhucka mhucka deleted the mh-add-pytest-xdist branch June 7, 2025 03:18
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