depot/third_party/nixpkgs/pkgs/development/python-modules/pytest-xdist/setup-hook.sh
Default email 22017988c6 Project import generated by Copybara.
GitOrigin-RevId: c777cdf5c564015d5f63b09cc93bef4178b19b01
2022-04-27 11:35:20 +02:00

18 lines
587 B
Bash

pytestXdistHook() {
pytestFlagsArray+=(
"--numprocesses=$NIX_BUILD_CORES"
"--forked"
)
}
# the flags should be added before pytestCheckHook runs so
# until we have dependency mechanism in generic builder, we need to use this ugly hack.
if [ -z "${dontUsePytestXdist-}" ] && [ -z "${dontUsePytestCheck-}" ]; then
if [[ " ${preDistPhases:-} " =~ " pytestCheckPhase " ]]; then
preDistPhases+=" "
preDistPhases="${preDistPhases/ pytestCheckPhase / pytestXdistHook pytestCheckPhase }"
else
preDistPhases+=" pytestXdistHook"
fi
fi