pytestCheckHook: Add disabledTestFiles option
This commit is contained in:
parent
2982fa466e
commit
6f7f01a244
@ -610,6 +610,10 @@ Using the example above, the analagous pytestCheckHook usage would be:
|
|||||||
"download"
|
"download"
|
||||||
"update"
|
"update"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
disabledTestFiles = [
|
||||||
|
"tests/test_failing.py"
|
||||||
|
];
|
||||||
```
|
```
|
||||||
|
|
||||||
This is expecially useful when tests need to be conditionallydisabled,
|
This is expecially useful when tests need to be conditionallydisabled,
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
echo "Sourcing pytest-check-hook"
|
echo "Sourcing pytest-check-hook"
|
||||||
|
|
||||||
declare -ar disabledTests
|
declare -ar disabledTests
|
||||||
|
declare -ar disabledTestFiles
|
||||||
|
|
||||||
function _concatSep {
|
function _concatSep {
|
||||||
local result
|
local result
|
||||||
@ -36,6 +37,13 @@ function pytestCheckPhase() {
|
|||||||
disabledTestsString=$(_pytestComputeDisabledTestsString "${disabledTests[@]}")
|
disabledTestsString=$(_pytestComputeDisabledTestsString "${disabledTests[@]}")
|
||||||
args+=" -k \""$disabledTestsString"\""
|
args+=" -k \""$disabledTestsString"\""
|
||||||
fi
|
fi
|
||||||
|
for file in "${disabledTestFiles[@]}"; do
|
||||||
|
if [ ! -f "$file" ]; then
|
||||||
|
echo "Disabled test file \"$file\" does not exist. Aborting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
args+=" --ignore=$file"
|
||||||
|
done
|
||||||
args+=" ${pytestFlagsArray[@]}"
|
args+=" ${pytestFlagsArray[@]}"
|
||||||
eval "@pythonCheckInterpreter@ $args"
|
eval "@pythonCheckInterpreter@ $args"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user