Skip to content

Commit ca41803

Browse files
greenc-FNALCopilot
andcommitted
Check for pytest module instead of command
We use the module, so check for the module—availability of the command is irrelevant. Per #250 (comment) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 34b1ec6 commit ca41803

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/coverage.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -832,14 +832,14 @@ generate_python_coverage() {
832832
exit 1
833833
fi
834834

835-
# Check for pytest and pytest-cov
836-
if ! command -v pytest >/dev/null 2>&1; then
837-
error "pytest not found. Install it with: pip install pytest pytest-cov"
835+
# Check for pytest and pytest-cov in the selected Python
836+
if ! "$PYTHON_CMD" -c "import pytest" 2>/dev/null; then
837+
error "pytest not found in $PYTHON_CMD environment. Install it with: $PYTHON_CMD -m pip install pytest pytest-cov"
838838
exit 1
839839
fi
840840

841841
if ! "$PYTHON_CMD" -c "import pytest_cov" 2>/dev/null; then
842-
error "pytest-cov not found. Install it with: pip install pytest-cov"
842+
error "pytest-cov not found in $PYTHON_CMD environment. Install it with: $PYTHON_CMD -m pip install pytest-cov"
843843
exit 1
844844
fi
845845

0 commit comments

Comments
 (0)