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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76a1510114e46d0d7244215ff4ec4ec22093317a6f819fd4e8ac46fe824271ef
|
|
| MD5 |
1e67fab89a86aab47b032f52f71e1265
|
|
| BLAKE2b-256 |
cf76b1391f8537a18c2ad3ebb480a779a048596dde2117f25ebc690c92b10bd8
|
Provenance
The following attestation bundles were made for pytest_mergify-2026.5.27.1.tar.gz:
Publisher:
release.yml on Mergifyio/pytest-mergify
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_mergify-2026.5.27.1.tar.gz -
Subject digest:
76a1510114e46d0d7244215ff4ec4ec22093317a6f819fd4e8ac46fe824271ef - Sigstore transparency entry: 1643285349
- Sigstore integration time:
-
Permalink:
Mergifyio/pytest-mergify@0ffc2cc9442bc692024bf227e9ae655dd8f8ba29 -
Branch / Tag:
refs/tags/2026.5.27.1 - Owner: https://github.com/Mergifyio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0ffc2cc9442bc692024bf227e9ae655dd8f8ba29 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pytest_mergify-2026.5.27.1-py3-none-any.whl.
File metadata
- Download URL: pytest_mergify-2026.5.27.1-py3-none-any.whl
- Upload date:
- Size: 34.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
708377f08cce7985c06354e4e3c3c5982a9112a9155273d4f30ec7cde92ee8f3
|
|
| MD5 |
b2ab455611caab14db43266b29b0d389
|
|
| BLAKE2b-256 |
8b3ce6d8fe75816d3d27236c55502094ab44565110cc6ce7e76dba789acb8568
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_mergify-2026.5.27.1-py3-none-any.whl -
Subject digest:
708377f08cce7985c06354e4e3c3c5982a9112a9155273d4f30ec7cde92ee8f3 - Sigstore transparency entry: 1643285396
- Sigstore integration time:
-
Permalink:
Mergifyio/pytest-mergify@0ffc2cc9442bc692024bf227e9ae655dd8f8ba29 -
Branch / Tag:
refs/tags/2026.5.27.1 - Owner: https://github.com/Mergifyio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0ffc2cc9442bc692024bf227e9ae655dd8f8ba29 -
Trigger Event:
release
-
Statement type: