Skip to main content

Qase TestOps Tavern Reporter

PyPI version PyPI downloads License

Qase Tavern Reporter enables seamless integration between your Tavern API tests and Qase TestOps, providing automatic test result reporting, test case management, and comprehensive test analytics.

Features

  • Link automated tests to Qase test cases by ID
  • Auto-create test cases from your test files
  • Report test results with test stages as steps
  • Multi-project reporting support
  • Flexible configuration (file, environment variables, CLI)

Installation

pip install qase-tavern

Quick Start

1. Create qase.config.json in your project root:

{
  "mode": "testops",
  "testops": {
    "project": "YOUR_PROJECT_CODE",
    "api": {
      "token": "YOUR_API_TOKEN",
      "host": "qase.io"
    }
  }
}

If your workspace is on the EU cluster (you open Qase at app-eu.qase.io), set host to eu.qase.io. The default, qase.io, is the US cluster.

2. Add Qase ID to your test:

---
test_name: QaseID=1 Get user by ID

stages:
  - name: Get user
    request:
      url: https://api.example.com/users/1
      method: GET
    response:
      status_code: 200

3. Run your tests:

pytest

Configuration

The reporter is configured via (in order of priority):

  1. CLI options (--qase-*, highest priority)
  2. Environment variables (QASE_*)
  3. Config file (qase.config.json)

Minimal Configuration

Option Environment Variable CLI Option Description
mode QASE_MODE --qase-mode Set to testops to enable reporting
testops.project QASE_TESTOPS_PROJECT --qase-testops-project Your Qase project code
testops.api.token QASE_TESTOPS_API_TOKEN --qase-testops-api-token Your Qase API token
testops.api.host QASE_TESTOPS_API_HOST — qase.io (US cluster, the default) or eu.qase.io (EU cluster). Required if your workspace is on the EU cluster

Example qase.config.json

{
  "mode": "testops",
  "fallback": "report",
  "testops": {
    "project": "YOUR_PROJECT_CODE",
    "api": {
      "token": "YOUR_API_TOKEN",
      "host": "qase.io"
    },
    "run": {
      "title": "Tavern API Tests"
    },
    "batch": {
      "size": 100
    }
  },
  "report": {
    "driver": "local",
    "connection": {
      "local": {
        "path": "./build/qase-report",
        "format": "json"
      }
    }
  }
}

Full configuration reference: See qase-python-commons for all available options including logging, status mapping, execution plans, and more.

Usage

Associate your tests with Qase test cases by adding QaseID={ID} to the test name:

---
test_name: QaseID=1 Get user profile

stages:
  - name: Get user profile
    request:
      url: https://api.example.com/profile
      method: GET
    response:
      status_code: 200
      json:
        id: 1
        name: "John Doe"

Multiple Qase IDs

Link one test to multiple test cases:

---
test_name: QaseID=1,2,3 User authentication flow

stages:
  - name: Login
    request:
      url: https://api.example.com/auth/login
      method: POST
      json:
        username: testuser
        password: testpass
    response:
      status_code: 200

Test Result Statuses

Tavern Result Qase Status
Passed passed
Failed (assertion) failed
Failed (other) invalid
Skipped skipped

Stages as Steps

Each Tavern stage is automatically reported as a test step in Qase:

---
test_name: QaseID=1 Complete order flow

stages:
  - name: Add item to cart          # Step 1
    request:
      url: https://api.example.com/cart
      method: POST
    response:
      status_code: 201

  - name: Proceed to checkout       # Step 2
    request:
      url: https://api.example.com/checkout
      method: POST
    response:
      status_code: 200

  - name: Complete payment          # Step 3
    request:
      url: https://api.example.com/payment
      method: POST
    response:
      status_code: 200

For detailed usage examples, see the Usage Guide.

Running Tests

Basic Execution

pytest

With CLI Options

pytest \
    --qase-mode=testops \
    --qase-testops-project=PROJ \
    --qase-testops-api-token=your_token

With Environment Variables

export QASE_MODE=testops
export QASE_TESTOPS_PROJECT=PROJ
export QASE_TESTOPS_API_TOKEN=your_token
export QASE_TESTOPS_API_HOST=qase.io  # eu.qase.io for the EU cluster
pytest

Run Specific Test File

pytest test_api.tavern.yaml

Requirements

  • Python >= 3.9
  • tavern >= 2.11.0

Documentation

Guide Description
Usage Guide Complete usage reference with all options
Multi-Project Support Reporting to multiple Qase projects

Examples

See the examples directory for complete working examples.

License

Apache License 2.0. See LICENSE for details.

Metadata

Release files for qase-tavern 4.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qase-tavern 4.0.2
File Size Uploaded Provenance Actions
qase_tavern-4.0.2.tar.gz 22.4 kB Without provenance Details for qase_tavern-4.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qase-tavern 4.0.2
File Interpreter ABI Platform Actions
qase_tavern-4.0.2-py3-none-any.whl Python 3 none any Details for qase_tavern-4.0.2-py3-none-any.whl

Total release size: 38.1 kB

Release files / qase_tavern-4.0.2.tar.gz

Download URL qase_tavern-4.0.2.tar.gz
Size 22.4 kB
Tags Source
SHA-256 checksum
How to use checksums
641e417209c26f8f478a3e75b0a3342f29b33e2c33e68ec9ba3b7839311d8e43
BLAKE2b-256 checksum
How to use checksums
87e71748d43a80d771c743f5655569dda2c2724750efef75a34a4db964b32ab7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / qase_tavern-4.0.2-py3-none-any.whl

Download URL qase_tavern-4.0.2-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff0194488ed9678a4891756cf819c444b8b02a121105e6180062fc583ff02d02
BLAKE2b-256 checksum
How to use checksums
2b6e1be87533e679c2b94dfeba0dd504638f10dcc53f62d187a1c26a7581bec5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for qase-tavern 4.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page