Skip to main content

qualflare-pytest

PyPI CI Qualflare License: Apache-2.0

A native pytest plugin for Qualflare — captures results directly from your pytest run: status, per-attempt retry history and flakiness, steps, attachments, and author-facing metadata (labels, links, tags, priority, custom parameters).

Without it, pytest results reach Qualflare through --junitxml, which carries pass/fail, duration and a class name — no per-attempt history, no attachments, no metadata. pytest writes a retried test as repeated bare <testcase> elements with no failure text on the attempts that failed, so what each attempt did is absent from the file rather than merely unparsed.

The plugin makes no network calls. It writes a report directory, and qualflare-cli uploads it.

Install

pip install qualflare-pytest

Requires Python 3.9+ and pytest 7.0+. It registers itself on install — there is no -p flag to add. pytest-xdist and pytest-rerunfailures are supported but optional; the plugin works, and is tested, without either.

Quickstart

pytest
brew install qualflare/tap/qf     # or: npm install -g @qualflare/cli
qf login my-project "$QUALFLARE_TOKEN" --force
qf my-project collect ./qualflare-results

qualflare-cli is a standalone Go binary, not a Python package — pip install qualflare-cli will not find anything. Homebrew and npm are the two channels; the release page also carries plain binaries for every platform.

Configure it in pytest.ini, pyproject.toml or setup.cfg:

[pytest]
qualflare_environment = staging
qualflare_output_dir = qualflare-results

Every option and environment variable is in docs/CONFIGURATION.md.

Parallel runs

pytest -n auto is supported and needs no configuration. Metadata attached in a worker travels to the controller on the test report, and the controller writes one report for the whole run. The plugin's own CI asserts that pytest and pytest -n 2 produce the same report.

The xdist worker index is recorded as each case's shard index, so a distributed run is attributed correctly without the record_property("shard", …) workaround the JUnit path needs.

Enriching your tests

from qualflare_pytest import qualflare

def test_checks_out():
    qualflare.label("feature", "checkout")
    qualflare.link("https://example.com/issue/42", type="issue", name="QF-42")
    qualflare.tag("smoke")
    qualflare.priority("high")

    with qualflare.step("add to cart"):
        qualflare.parameter("sku", "widget")
        qualflare.parameter("token", os.environ["TOKEN"], masked=True)

Markers become tags automatically, so a suite already using @pytest.mark.smoke for selection gets that dimension in Qualflare with no code change. When pytest-bdd is installed, Gherkin steps are recorded with their keyword and location too.

Full reference in docs/METADATA-API.md.

Test reports

This plugin is tested with itself. e2e/ is a pytest suite covering this package's own behaviour — the metadata API, nested steps, retry history and attachments — run by this plugin and uploaded to Qualflare on every merge to main, using the published qualflare-cli. The results below are that suite's, reported through the code this README documents:

Qualflare

Every case there is meant to pass, so a red run is a real regression rather than a fixture failing on purpose. Deliberately-failing cases live in tests/, which is never uploaded.

Known limitations

  • xfail and xpass are flattened to skipped and passed. Under xfail(strict=True) an unexpected pass is a failure in pytest but reads as an ordinary pass here.
  • record_property is ignored. Use qualflare.parameter() or qualflare.label(), which do reach the report.
  • Captured stdout/stderr are not attached. Attach what you need explicitly.

Full details in docs/LIMITATIONS.md.

License

Apache-2.0 — see LICENSE.

Metadata

Release files for qualflare-pytest 0.1.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 qualflare-pytest 0.1.2
File Size Uploaded
qualflare_pytest-0.1.2.tar.gz 58.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for qualflare-pytest 0.1.2
File Interpreter ABI Platform
qualflare_pytest-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 89.5 kB

Release files / qualflare_pytest-0.1.2.tar.gz

Download URL qualflare_pytest-0.1.2.tar.gz
Size 58.4 kB
Tags Source
SHA-256 checksum
How to use checksums
212a25e213226dde2d2b8c7c58b512ae4892b8e879cd7e8651e01ed9e4988e74
BLAKE2b-256 checksum
How to use checksums
47e48ceb2d21bb5c940ea2dd1a46888b41d7d7ffc1b6f52c6e43b70535d56e4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release files / qualflare_pytest-0.1.2-py3-none-any.whl

Download URL qualflare_pytest-0.1.2-py3-none-any.whl
Size 31.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
140b5c061c561dce3a590bd6ebc42cc9c956f614f5dff8fecc5a660e92d91d37
BLAKE2b-256 checksum
How to use checksums
ed2e172652bd0de1c36e4693fed59653fe27b0e24bd467d4dcac309dd87897c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

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