Skip to main content

Pytest plugin for Mergify

Project description

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

Project details


Release history Release notifications | RSS feed

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.5.27.1.tar.gz (80.7 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.5.27.1-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pytest_mergify-2026.5.27.1.tar.gz
Algorithm Hash digest
SHA256 76a1510114e46d0d7244215ff4ec4ec22093317a6f819fd4e8ac46fe824271ef
MD5 1e67fab89a86aab47b032f52f71e1265
BLAKE2b-256 cf76b1391f8537a18c2ad3ebb480a779a048596dde2117f25ebc690c92b10bd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_mergify-2026.5.27.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.5.27.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_mergify-2026.5.27.1-py3-none-any.whl
Algorithm Hash digest
SHA256 708377f08cce7985c06354e4e3c3c5982a9112a9155273d4f30ec7cde92ee8f3
MD5 b2ab455611caab14db43266b29b0d389
BLAKE2b-256 8b3ce6d8fe75816d3d27236c55502094ab44565110cc6ce7e76dba789acb8568

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_mergify-2026.5.27.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.

Supported by

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