pipeline { agent { docker { image 'python:3.7' } } environment { HOME = "$WORKSPACE" } stages { stage('install dependencies') { steps { sh 'pip3 install --user pytest' } } stage('run tests') { steps { sh '$HOME/.local/bin/pytest code/test.py' } } } }