You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FROM python:3.9-alpine
RUN mkdir /pytest-container
COPY . /pytest-container
WORKDIR /pytest-container
RUN pip install --upgrade pip
RUN pip3 install -r requirements.txt
Build image:
docker build -t pytest-image .
Create a container:
docker run -ti --name pytest-container pytest-image /bin/sh
Run test inside container CLI:
pytest -s -v tests/test_sample.py
OR
Dockerfile
FROM python:3.9-alpine
RUN mkdir /pytest-container
COPY . /pytest-container
WORKDIR /pytest-container
RUN pip install --upgrade pip
RUN pip3 install -r requirements.txt
ENTRYPOINT pytest -s -v tests/test_sample.py
Build image:
docker build -t pytest-image .
Create a container:
docker run -ti --name pytest-container pytest-image