Skip to content

Commit bc3ac08

Browse files
dtrouninearmandsauzay
authored andcommitted
fix: make the Test action fail in case of missing pytest dependency
1 parent 50301aa commit bc3ac08

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/action.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ runs:
6868
elif [[ -f setup.py ]]; then
6969
python setup.py test -- ${{ inputs.test-flags }}
7070
else
71-
pip install pytest pytest-cov
72-
pytest ${{ inputs.test-flags }}
71+
echo "::error::pytest not found in the dependencies, cannot run tests"
72+
exit 1
7373
fi
7474
# If we do have a poetry.lock, we use a poetry based workflow
7575
- name: install poetry
@@ -92,7 +92,8 @@ runs:
9292
if poetry show pytest &>/dev/null; then
9393
poetry run pytest ${{ inputs.test-flags }}
9494
else
95-
echo "::warning::pytest not found in poetry.lock"
95+
echo "::error::pytest not found in poetry.lock, cannot run tests"
96+
exit 1
9697
fi
9798
- name: Upload coverage
9899
if: inputs.upload-coverage != 'false'

0 commit comments

Comments
 (0)