depot/third_party/nixpkgs/pkgs/development/python-modules/pytest-xdist/setup-hook.sh
Default email 0d9fc34957 Project import generated by Copybara.
GitOrigin-RevId: 5ed481943351e9fd354aeb557679624224de38d5
2023-01-20 11:41:00 +01:00

17 lines
568 B
Bash

pytestXdistHook() {
pytestFlagsArray+=(
"--numprocesses=$NIX_BUILD_CORES"
)
}
# 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