A simple Python calculator demonstrating pytest with HTML report generation for Gaffer.
# Create virtual environment (optional but recommended)
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt# Run tests (basic)
pytest
# Run tests with HTML report
pytest --html=reports/pytest-report.html --self-contained-html- pytest HTML:
reports/pytest-report.html
curl -X POST https://app.gaffer.sh/api/upload \
-H "X-API-Key: $GAFFER_UPLOAD_TOKEN" \
-F "files=@reports/pytest-report.html"See .github/workflows/pytest.yml for the full workflow.