On 12. 07. 22 11:25, Petr Viktorin wrote:
Or pytest-xdist could be taught to check an environment variable for `auto`, making this seamless for packagers?
This could work, except that sometimes pytest-xdist is installed and we don't want to run tests in parallel because they are not prepared for that. But I guess an opt-out would still exist, e.g. setting %{_smp_build_ncpus} to 1 in the %check section.
I will have a look if there is an environment variable we could use. We can probably adjust PYTEST_ADDOPTS if we detect pytest-xdist is available.
I meant teaching pytest-xdist to look at an envvar, which would just be ignored if xdist isn't around. Actually I just went ahead and proposed it upstream: https://github.com/pytest-dev/pytest-xdist/issues/792
Oh, now I get it. Perfect!