Pytest
The pytest framework makes it easy to write small, readable tests, and can scale to support complex functional testing for applications and libraries. pytest unit can generate standard format JUnit-style XML files which can be submited to Testfiesta or Testrail using taco truck cli. You just need to install the popular pytest , and install Tacotruck CLI or use Github action. Check out simple pytest example.
Configuration
To generate xml file, report file path should be included in command.
pytest --junitxml=test-results.xmlInstall Tacotruck CLI
$ npm install -g @testfiesta/tacotruckSubmit test results
tacotruck testfiesta \
run:submit \
--token testfiesta_... \
--handle orgHandle \
--project projectKey \
--name runName \
--data results-path/*.xmlGithub Action
name: Python Tests
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 📦 Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: 📦 Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: 🧪 Run tests
run: |
pytest --junitxml=test-results.xml
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: pytest-results
path: test-results.xml
if: always()
- name: Report Results
uses: testfiesta/tacotruck-action@v1
with:
provider: testfiesta
Support and Resources
Last updated