Browse Source

test(scripting-piscine): improve py exercise tester

switch from py2 to py3
make pytest stop at first failure
DEV-4199-make-test-environment-compatible-with-python-exercises
Michele Sessa 1 year ago
parent
commit
0c38e41444
  1. 4
      sh/tests/Dockerfile
  2. 2
      sh/tests/entrypoint.sh

4
sh/tests/Dockerfile

@ -2,8 +2,8 @@ FROM docker.01-edu.org/debian:10.9-slim
RUN apt-get update
RUN apt-get -y install jq curl
RUN apt-get -y install python-pip
RUN pip install -U pytest
RUN apt-get -y install python3-pip
RUN pip3 install -U pytest
WORKDIR /app/assets/superhero
RUN curl --remote-name --location https://demo.01-edu.org/assets/superhero/all.json

2
sh/tests/entrypoint.sh

@ -9,7 +9,7 @@ cd app
if test -f "${EXERCISE}_test.sh"; then
bash "${EXERCISE}_test.sh"
elif test -f "${EXERCISE}_test.py"; then
pytest "${EXERCISE}_test.py"
pytest -x "${EXERCISE}_test.py"
else
echo "No test file found for the exercise : $EXERCISE"
exit 1

Loading…
Cancel
Save