0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 13:40:28 +03:00

python3Packages.pytestCheckHook: fix disabledTestPaths glob matching assertion

Errors in Bash's process substitution doesn't get propagated outside.

Replace the process substitution with Python's `-` as /dev/stdin and
Bash's heredoc stdin redirection.
This commit is contained in:
Yueh-Shun Li 2025-03-03 00:57:23 +08:00
parent db42c3a6c0
commit 2e512e7cf7

View file

@ -18,7 +18,7 @@ function pytestCheckPhase() {
concatTo _pathsArray disabledTestPaths
for path in "${_pathsArray[@]}"; do
# Check if every path glob matches at least one path
@pythonCheckInterpreter@ <(cat <<EOF
@pythonCheckInterpreter@ - "$path" <<EOF
import glob
import sys
path_glob=sys.argv[1]
@ -27,7 +27,6 @@ if not len(path_glob):
if next(glob.iglob(path_glob), None) is None:
sys.exit('Disabled tests path glob "{}" does not match any paths. Aborting'.format(path_glob))
EOF
) "$path"
flagsArray+=("--ignore-glob=$path")
done