Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Control auto worker count through environment variable #110

Open
kburns opened this issue Mar 26, 2022 · 0 comments
Open

Control auto worker count through environment variable #110

kburns opened this issue Mar 26, 2022 · 0 comments

Comments

@kburns
Copy link

kburns commented Mar 26, 2022

Hello and thanks for the great package! I think it could be useful to allow the user to set an environment variable that determines the number of workers to use with --workers auto, maybe something like PYTEST_AUTO_WORKERS, and fallback to the current behavior using os.cpu_count() if that environment variable is not set. Is that a feature you might be interested in? If so I'd be happy to put in a PR.

The use case I have in mind is when you have a workflow that tests with pytest-parallel and the automatic worker count, but on some machines (e.g. when running on your laptop instead of a workstation or cluster) you might want to prevent pytest from using all available cores to keep the UI responsive, etc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant