Registry / testing / pytest-mergify

pytest-mergify

JSON →
library2026.5.27.1pypypi✓ verified 88d ago

A pytest plugin that reports test results to Mergify for merge queue optimization. Current version 2026.4.7.1, requires Python >=3.8. Released frequently (almost daily) with version numbers based on date.

pip install pytest-mergify
INSTALL
IMPORT
SIG · PYTEST-MERGIFY
P
pytest-mergify
testingpythonv2026.5.27.1
Install
4.6s avg
Import
1241ms
Disk
42MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2026.5.27.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 1.394s · 42.5MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 4.6s · import 1.088s · 43MB
42MB installed
● package 42MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pytest_mergify
✓ import pytest_mergify
The package is imported as a module, but typically used as a pytest plugin via command line option.

Write a simple test, then run: `pytest --mergify` or set MERGIFY_TOKEN env var.

import pytest def test_example(): assert 1 + 1 == 2
Debug
Known issues
gotchaThe MERGIFY_TOKEN environment variable is required for the plugin to work. Without it, tests will run but results won't be reported.
fix
Set MERGIFY_TOKEN before running pytest.
affects: all
deprecatedOlder versions used `--mergify-token` CLI argument; newer versions prefer environment variable.
fix
Use MERGIFY_TOKEN env var instead of CLI argument.
affects: <2026.0.0
breakingVersion 2025.10.0 changed the required Python version from 3.7 to 3.8.
fix
Ensure Python >= 3.8.
affects: >=2025.10.0
gotchaThe plugin only sends results on test session finish; it may fail silently if network is unavailable.
fix
Check network connectivity and verify API endpoint.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pytest_mergify'
The package is installed but not imported correctly; it's a pytest plugin, not a direct import.
fix
Use `pytest --mergify` instead of importing the module.
TypeError: __init__() got an unexpected keyword argument 'token'
Using old API with `--mergify-token` where plugin expects env var.
fix
Remove the CLI argument and set MERGIFY_TOKEN environment variable.
pytest: error: unrecognized arguments: --mergify
The plugin is not installed or not registered in pytest.
fix
Run `pip install pytest-mergify` and ensure it's in the environment.
Upgrade
Version history
2026.5.27.1latest on PyPI · released May 27, 2026
Audit
Dependencies
pytestrequiredRequired as a plugin for pytest.
requestsrequiredUsed to send test results to Mergify API.
Agent activity
7 hits · last 30 days
node
6
Resources
pytest-mergify — pip install pytest-mergify · libregistry