Complete the code to run PyTest in a Jenkins pipeline step.
sh 'pytest [1]'
The --verbose option runs PyTest with detailed output, which is useful in Jenkins logs.
Complete the Jenkinsfile step to archive PyTest test reports.
archiveArtifacts artifacts: '[1]', fingerprint: true
PyTest can generate test reports in XML format, usually named test-results.xml, which Jenkins archives.
Fix the error in the Jenkins pipeline command to run PyTest with junitxml output.
sh 'pytest --junitxml=[1]'
The --junitxml option requires a filename ending with .xml to save the test report.
Fill both blanks to run PyTest only on files in the tests directory and generate XML report.
sh 'pytest [1] --junitxml=[2]'
Use tests/ to specify the folder with tests and results.xml as the XML report file.
Fill all three blanks to create a Jenkins pipeline step that runs PyTest with verbose output, saves XML report, and archives it.
sh 'pytest [1] --junitxml=[2]' archiveArtifacts artifacts: '[3]', fingerprint: true
Run PyTest with --verbose, save report as results.xml, and archive the XML file with **/results.xml pattern.