Skip to main content

qualflare-pytest

PyPI CI 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 retry history, no attachments, no metadata.

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
pip install qualflare-cli
qf login my-project "$QUALFLARE_TOKEN" --force
qf my-project collect ./qualflare-results

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.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qualflare_pytest-0.1.1.tar.gz (35.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qualflare_pytest-0.1.1-py3-none-any.whl (30.6 kB view details)

Uploaded Python 3

File details

Details for the file qualflare_pytest-0.1.1.tar.gz.

File metadata

  • Download URL: qualflare_pytest-0.1.1.tar.gz
  • Upload date:
  • Size: 35.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for qualflare_pytest-0.1.1.tar.gz
Algorithm Hash digest
SHA256 03208670d42a9a9cbacb37975e0e8ca0b5ff797a82dfaf842b9ef5580d1ab419
MD5 4da61167a189468dc9f7217591fd25cb
BLAKE2b-256 5cc77472cafcab81b432be5e9aca7cfd1a8d94c36fd66bae072860c1051c689a

See more details on using hashes here.

Provenance

The following attestation bundles were made for qualflare_pytest-0.1.1.tar.gz:

Publisher: release.yml on Qualflare/qualflare-pytest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qualflare_pytest-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for qualflare_pytest-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 99a4adc99de46387261adb1a511a13eae7fba7b4abbc350907754e722b37f08c
MD5 db56aa183c99923a75ccb0f529413961
BLAKE2b-256 6610a2f11b5cb8c26d790626b0f24d981bb72e4a27c8ac99f0db45a27b065cdc

See more details on using hashes here.

Provenance

The following attestation bundles were made for qualflare_pytest-0.1.1-py3-none-any.whl:

Publisher: release.yml on Qualflare/qualflare-pytest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 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