From 160b7f1e171e2432a68a32c6804bd7d4ed4d2b18 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Fri, 1 Nov 2024 04:21:16 +0800 Subject: [PATCH] pytest-forked: setup-hook: simplify pytestForkedHook insertion with replaceElement --- .../python-modules/pytest-forked/setup-hook.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pkgs/development/python-modules/pytest-forked/setup-hook.sh b/pkgs/development/python-modules/pytest-forked/setup-hook.sh index 0eff690e9079e..6255c1dc7ea2a 100644 --- a/pkgs/development/python-modules/pytest-forked/setup-hook.sh +++ b/pkgs/development/python-modules/pytest-forked/setup-hook.sh @@ -17,15 +17,8 @@ pytestForkedHook() { if [ -z "${dontUsePytestForked-}" ] && [ -z "${dontUsePytestCheck-}" ]; then if [[ " ${preDistPhases[*]:-} " =~ " pytestCheckPhase " ]]; then - _preDistPhases="${preDistPhases[*]} " - _preDistPhases="${_preDistPhases/ pytestCheckPhase / pytestForkedHook pytestCheckPhase }" - if [[ -n "${__structuredAttrs-}" ]]; then - preDistPhases=() - else - preDistPhases="" - fi - appendToVar preDistPhases $_preDistPhases - unset _preDistPhases + # Insert pytestForkedHook before pytestCheckPhase + replaceElement preDistPhases pytestCheckPhase pytestForkedHook pytestCheckPhase else appendToVar preDistPhases pytestForkedHook fi