about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pytest-xdist/setup-hook.sh
blob: 5523a7f360f5f371e31730fcda02bfa6edf1bbf7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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