From b5facab1efb476520dd62de05d3bde2e571b333c Mon Sep 17 00:00:00 2001 From: Artturin Date: Wed, 6 Apr 2022 09:04:48 +0300 Subject: [PATCH] python39Packages.pytest-xdist: run xdist hook before pytestCheckPhase --- .../python-modules/pytest-xdist/setup-hook.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/pytest-xdist/setup-hook.sh b/pkgs/development/python-modules/pytest-xdist/setup-hook.sh index 877fcf26d0cf..5523a7f360f5 100644 --- a/pkgs/development/python-modules/pytest-xdist/setup-hook.sh +++ b/pkgs/development/python-modules/pytest-xdist/setup-hook.sh @@ -5,6 +5,14 @@ pytestXdistHook() { ) } +# 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 - preDistPhases+=" pytestXdistHook" + if [[ " ${preDistPhases:-} " =~ " pytestCheckPhase " ]]; then + preDistPhases+=" " + preDistPhases="${preDistPhases/ pytestCheckPhase / pytestXdistHook pytestCheckPhase }" + else + preDistPhases+=" pytestXdistHook" + fi fi