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"
|
||||
"update"
|
||||
];
|
||||
|
||||
disabledTestFiles = [
|
||||
"tests/test_failing.py"
|
||||
];
|
||||
```
|
||||
|
||||
This is expecially useful when tests need to be conditionallydisabled,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
echo "Sourcing pytest-check-hook"
|
||||
|
||||
declare -ar disabledTests
|
||||
declare -ar disabledTestFiles
|
||||
|
||||
function _concatSep {
|
||||
local result
|
||||
|
@ -36,6 +37,13 @@ function pytestCheckPhase() {
|
|||
disabledTestsString=$(_pytestComputeDisabledTestsString "${disabledTests[@]}")
|
||||
args+=" -k \""$disabledTestsString"\""
|
||||
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[@]}"
|
||||
eval "@pythonCheckInterpreter@ $args"
|
||||
|
||||
|
|
Loading…
Reference in New Issue