pytestCheckHook: improve disabledTestPaths whitespace handling
This commit is contained in:
parent
7dd53fe56e
commit
2e55b7301b
|
@ -2,7 +2,7 @@
|
||||||
echo "Sourcing pytest-check-hook"
|
echo "Sourcing pytest-check-hook"
|
||||||
|
|
||||||
declare -ar disabledTests
|
declare -ar disabledTests
|
||||||
declare -ar disabledTestPaths
|
declare -a disabledTestPaths
|
||||||
|
|
||||||
function _concatSep {
|
function _concatSep {
|
||||||
local result
|
local result
|
||||||
|
@ -37,6 +37,11 @@ function pytestCheckPhase() {
|
||||||
disabledTestsString=$(_pytestComputeDisabledTestsString "${disabledTests[@]}")
|
disabledTestsString=$(_pytestComputeDisabledTestsString "${disabledTests[@]}")
|
||||||
args+=" -k \""$disabledTestsString"\""
|
args+=" -k \""$disabledTestsString"\""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "${disabledTestPaths-}" ]; then
|
||||||
|
eval "disabledTestPaths=($disabledTestPaths)"
|
||||||
|
fi
|
||||||
|
|
||||||
for path in ${disabledTestPaths[@]}; do
|
for path in ${disabledTestPaths[@]}; do
|
||||||
if [ ! -e "$path" ]; then
|
if [ ! -e "$path" ]; then
|
||||||
echo "Disabled tests path \"$path\" does not exist. Aborting"
|
echo "Disabled tests path \"$path\" does not exist. Aborting"
|
||||||
|
|
|
@ -93,6 +93,8 @@
|
||||||
|
|
||||||
, doCheck ? config.doCheckByDefault or false
|
, doCheck ? config.doCheckByDefault or false
|
||||||
|
|
||||||
|
, disabledTestPaths ? []
|
||||||
|
|
||||||
, ... } @ attrs:
|
, ... } @ attrs:
|
||||||
|
|
||||||
|
|
||||||
|
@ -108,6 +110,7 @@ let
|
||||||
|
|
||||||
self = toPythonModule (stdenv.mkDerivation ((builtins.removeAttrs attrs [
|
self = toPythonModule (stdenv.mkDerivation ((builtins.removeAttrs attrs [
|
||||||
"disabled" "checkPhase" "checkInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" "format"
|
"disabled" "checkPhase" "checkInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts" "format"
|
||||||
|
"disabledTestPaths"
|
||||||
]) // {
|
]) // {
|
||||||
|
|
||||||
name = namePrefix + name_;
|
name = namePrefix + name_;
|
||||||
|
@ -178,6 +181,8 @@ let
|
||||||
# If given use the specified checkPhase, otherwise use the setup hook.
|
# If given use the specified checkPhase, otherwise use the setup hook.
|
||||||
# Longer-term we should get rid of `checkPhase` and use `installCheckPhase`.
|
# Longer-term we should get rid of `checkPhase` and use `installCheckPhase`.
|
||||||
installCheckPhase = attrs.checkPhase;
|
installCheckPhase = attrs.checkPhase;
|
||||||
|
} // lib.optionalAttrs (disabledTestPaths != []) {
|
||||||
|
disabledTestPaths = lib.escapeShellArgs disabledTestPaths;
|
||||||
}));
|
}));
|
||||||
|
|
||||||
passthru.updateScript = let
|
passthru.updateScript = let
|
||||||
|
|
Loading…
Reference in New Issue