Skip to main content

pytest-mergify

Pytest plugin for Mergify Test Insights.

More information at https://mergify.com

Features

  • Test tracing — Sends OpenTelemetry traces for every test to Mergify's API
  • Flaky test detection — Intelligently reruns tests to detect flakiness with budget constraints
  • Test quarantine — Quarantines failing tests so they don't block CI

Installation

Install the package alongside pytest (>= 6.0.0):

pip install pytest-mergify

The plugin is auto-discovered by pytest — no manual registration required.

Configuration

Set the MERGIFY_TOKEN environment variable with your Mergify API token.

The plugin activates automatically when running in CI (detected via the CI environment variable). To enable outside CI, set PYTEST_MERGIFY_ENABLE=true.

Environment Variables

Variable Description Default
MERGIFY_TOKEN Mergify API authentication token (required)
MERGIFY_API_URL Mergify API endpoint https://api.mergify.com
PYTEST_MERGIFY_ENABLE Force-enable outside CI false
PYTEST_MERGIFY_DEBUG Print spans to console false
MERGIFY_TRACEPARENT W3C distributed trace context
MERGIFY_TEST_JOB_NAME Mergify test job name

For detailed documentation, see the official guide.

Development

Prerequisites

  • Python >= 3.8
  • uv

Setup

uv sync

Running Tests

uv run poe test

Linting

uv run poe linters

License

GPL-3.0-only

Download files

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

Source Distribution

pytest_mergify-2026.7.6.1.tar.gz (86.9 kB view details)

Uploaded Source

Built Distribution

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

pytest_mergify-2026.7.6.1-py3-none-any.whl (36.6 kB view details)

Uploaded Python 3

File details

Details for the file pytest_mergify-2026.7.6.1.tar.gz.

File metadata

  • Download URL: pytest_mergify-2026.7.6.1.tar.gz
  • Upload date:
  • Size: 86.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for pytest_mergify-2026.7.6.1.tar.gz
Algorithm Hash digest
SHA256 a52f76ba073aac05c0f4244bd7a65ae8343c75f25091e38b76c0f65a6d3dbbda
MD5 54790b32878d193090a3f6890c412da0
BLAKE2b-256 0da5b067c84c3017dee22dacbfe6577602b80f8ae75705d32aad2ade4ffd74c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_mergify-2026.7.6.1.tar.gz:

Publisher: release.yml on Mergifyio/pytest-mergify

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

File details

Details for the file pytest_mergify-2026.7.6.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_mergify-2026.7.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0e99a6260cc0ad7131b426e3ea6f043567cb963ace867e9d48f2cbb51a5b1061
MD5 0a23566e99bdc5a1ad9ecb1083a0349b
BLAKE2b-256 484da50b5e1830e554bf81a3bd346a3b799f79c20390eae2e74886f04b2d764e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_mergify-2026.7.6.1-py3-none-any.whl:

Publisher: release.yml on Mergifyio/pytest-mergify

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

Release history Release notifications | RSS feed

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page