Skip to content

Commit

Permalink
pytest-forked: setup-hook: simplify pytestForkedHook insertion with r…
Browse files Browse the repository at this point in the history
…eplaceElement
  • Loading branch information
ShamrockLee committed Oct 31, 2024
1 parent 3072c24 commit 160b7f1
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions pkgs/development/python-modules/pytest-forked/setup-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 160b7f1

Please sign in to comment.