Skip to content

enveryasar/pytest-local-jenkins

Repository files navigation

  • api_key = '4f8defcdf72c5c16da47804eacfaf7a1'

Two example Dockerfile

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

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

Run it with docker-compose.yml

Run
docker-compose up
Down
docker-compose down --rmi all

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors