Skip to content

Allure Integration

Export Schemathesis test results as Allure report files and turn them into an HTML report.

For a single run, the built-in HTML report needs no extra tools.

Prerequisites

  • The Allure CLI to generate and view the HTML report
  • Schemathesis with the allure extra (below), or the Docker image, which includes it

Installation

Allure support is an optional extra:

uv add 'schemathesis[allure]'

This installs allure-python-commons. If you cannot install the extra, use JUnit XML instead.

CLI Usage

Pass --report-allure-path to write Allure result files to a directory. With uvx, add the extra through --from:

uvx --from 'schemathesis[allure]' schemathesis run https://api.example.com/openapi.json \
    --report-allure-path allure-results

Each API operation is written as one <uuid>-result.json file in allure-results/. Then generate and open the report:

allure generate allure-results -o allure-report
allure open allure-report

Allure report overview showing API operations with pass/fail status

You can also configure it in schemathesis.toml which will work for CLI & pytest plugin alike:

[reports.allure]
path = "allure-results"

What the Report Shows

Each API operation becomes one Allure test result.

Failures appear as one step per unique failing request, titled Test Case: <id>, with check names, response body, and a curl command to reproduce.

Allure detail view showing a failed operation with a Test Case step expanded

CLI and pytest reports use the same statuses:

Status Meaning
passed The test completed successfully
failed A Schemathesis check or user assertion failed
broken Configuration, network, or user code raised an error
skipped pytest or Schemathesis skipped the test

Each result carries these labels:

Label Value
story Operation label, e.g. POST /users
framework schemathesis
layer API
epic API title from info.title (when present)
feature OpenAPI operation tags (only set when tags exist)
severity Highest severity among the operation's failures: blocker, critical, normal, or minor (only set on failure)

Dynamic Allure API

Inside @schema.parametrize() tests, standard allure calls work and are routed to the Schemathesis-managed result for that operation.

import allure


@schema.parametrize()
def test_api(case):
    allure.dynamic.title(f"Testing {case.method} {case.path}")
    allure.attach("extra context", name="note", attachment_type=allure.attachment_type.TEXT)
    allure.link("https://example.com/docs", name="API Docs")
    case.call_and_validate()

Coexistence with allure-pytest

If you use allure-pytest in the same suite, keep its results in a separate directory to avoid mixing result schemas:

# Schemathesis results
uvx --from 'schemathesis[allure]' schemathesis run https://api.example.com/openapi.json \
    --report-allure-path allure-results/schemathesis

# allure-pytest results go to allure-results/pytest (controlled by --alluredir)
pytest tests/ --alluredir=allure-results/pytest

allure-pytest reports Schemathesis check failures as failed. Configuration, network, and user-code errors are reported as broken. For from_fixture tests, allure-pytest keeps only the first failing operation per test.

Docker

The Schemathesis Docker image has Allure support pre-installed. Create a directory, mount it, and pass --report-allure-path to write raw result files to your host. Create the directory first: the container runs as UID 1000 and cannot write to a directory Docker creates as root (see Docker troubleshooting):

mkdir -p allure-results
docker run \
  -v ./allure-results:/app/allure-results \
  ghcr.io/schemathesis/schemathesis:stable \
  run --report-allure-path /app/allure-results \
  https://api.example.com/openapi.json

Then generate the report on your host using the Allure CLI:

allure generate allure-results -o allure-report
allure open allure-report

The Allure CLI is not included in the image — it is a separate Java tool. Run it on your host or in a dedicated CI step.

Without the Allure extra: JUnit XML

Allure also reads JUnit XML. Export it with --report junit and copy it into an Allure results directory:

uvx schemathesis run https://api.example.com/openapi.json --report junit
mkdir -p allure-results
cp schemathesis-report/*.xml allure-results/
allure generate allure-results -o allure-report
allure open allure-report

JUnit XML carries less detail than the native format: the labels and per-test-case steps described above are not included.

Troubleshooting

allure: command not found. The Allure CLI is a separate tool, not part of the Python package or the Docker image. Install it on the machine that builds the report.

ModuleNotFoundError: No module named 'allure_commons'. The allure extra is not installed. Install schemathesis[allure], or run uvx --from 'schemathesis[allure]' schemathesis run ....

Configuration Reference

See the Reporting section in the Configuration Options reference.