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.
Generate xml report file
To generate xml file, report file path should be included in command
pytest --junitxml=test-results.xml
Install tacotruck cli
$ npm install -g @testfiesta/tacotruck
Submit test results
tacotruck testfiesta \
run:submit \
--token testfiesta_... \
--handle orgHandle \
--project projectKey \
--name runName \
--data results-path/*.xml
Github 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
Last updated