--- id: pytest-mergify version: "2026.8.5.3" license: Apache-2.0 license_treatment: permissive maintenance: active --- # pytest-mergify — Pytest plugin for Mergify License: permissive · Maintenance: active · Downloads: 76.7K/mo ## What it is and what it does pytest-mergify is a pytest plugin that connects your test runs to Mergify's Test Insights platform via OpenTelemetry tracing. It automatically detects flaky tests by intelligently rerunning them within budget constraints, quarantines failing tests to prevent CI blockage, and can selectively run only previously-failing tests when Mergify's merge queue reruns a job—reducing redundant test execution. The plugin requires pytest >= 6.0.0 and pytest-timeout, auto-discovers without manual registration, and activates when running in CI (detected via the CI environment variable) or when explicitly enabled via PYTEST_MERGIFY_ENABLE=true. Configuration is minimal: set the MERGIFY_TOKEN environment variable with your API token, and optionally customize the API endpoint or debug output. Use it for: - Detect flaky tests in CI pipelines by automatically rerunning tests with budget constraints to identify intermittent failures. - Reduce merge queue wait time by running only tests that failed in the previous attempt when Mergify reruns a job. - Quarantine failing tests to prevent them from blocking CI while still capturing failure data for later analysis. - Trace test execution with OpenTelemetry spans sent to Mergify for centralized test insights and performance monitoring. - Opt out of test selection per-run by setting MERGIFY_TEST_SELECTION_DISABLE=true while keeping tracing and flaky detection active. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that integrates with Mergify to trace tests via OpenTelemetry, detect flaky tests, quarantine failures, and selectively run only previously-failing tests in merge queue reruns. Yes, if you use Mergify and want to reduce CI time and improve test reliability. The plugin is actively maintained, has no known vulnerabilities, uses a permissive license, and requires only pytest and pytest-timeout. Install friction is medium due to compiled wheels, but the stable ABI (cp38-abi3) covers modern Python versions. The main gotcha is that MERGIFY_TOKEN must be set and test selection requires organization opt-in on Mergify's side, but these are configuration rather than blocker issues. ## Install pip install pytest-mergify uv add pytest-mergify poetry add pytest-mergify ## Installing pytest-mergify Before you install: Medium install friction due to compiled wheels across multiple platforms (cp38-abi3 stable ABI). Active maintenance with a release 9 days old. Requires pytest and pytest-timeout as runtime dependencies. License in practice: Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects. Quickstart: pip install pytest-mergify # Set required environment variable export MERGIFY_TOKEN=your_token # Run pytest normally; plugin auto-discovers pytest Requires MERGIFY_TOKEN environment variable to be set; plugin activates automatically in CI or when PYTEST_MERGIFY_ENABLE=true is set. Verify before relying: - Whether test selection feature requires explicit organization opt-in on Mergify's side beyond environment setup. - Performance impact of OpenTelemetry tracing on large test suites. - Compatibility with pytest fixtures and parametrization in flaky detection reruns. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 76.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest mergify integration, test tracing opentelemetry, flaky test detection, ci test insights, merge queue test selection, pytest plugin ci, test quarantine, ci-integration, test-reliability, opentelemetry [View on SkillFed](https://skillfed.io/packages/pytest-mergify) · [View on PyPI](https://pypi.org/project/pytest-mergify/)