{"id":24433,"library":"pytest-mergify","title":"pytest-mergify","description":"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.","status":"active","version":"2026.4.7.1","language":"python","source_language":"en","source_url":"https://github.com/Mergifyio/pytest-mergify","tags":["pytest","plugin","mergify","ci","merge-queue"],"install":[{"cmd":"pip install pytest-mergify","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required as a plugin for pytest.","package":"pytest","optional":false},{"reason":"Used to send test results to Mergify API.","package":"requests","optional":false}],"imports":[{"note":"The package is imported as a module, but typically used as a pytest plugin via command line option.","symbol":"pytest_mergify","correct":"import pytest_mergify"}],"quickstart":{"code":"import pytest\n\ndef test_example():\n    assert 1 + 1 == 2\n","lang":"python","description":"Write a simple test, then run: `pytest --mergify` or set MERGIFY_TOKEN env var."},"warnings":[{"fix":"Set MERGIFY_TOKEN before running pytest.","message":"The MERGIFY_TOKEN environment variable is required for the plugin to work. Without it, tests will run but results won't be reported.","severity":"gotcha","affected_versions":"all"},{"fix":"Use MERGIFY_TOKEN env var instead of CLI argument.","message":"Older versions used `--mergify-token` CLI argument; newer versions prefer environment variable.","severity":"deprecated","affected_versions":"<2026.0.0"},{"fix":"Ensure Python >= 3.8.","message":"Version 2025.10.0 changed the required Python version from 3.7 to 3.8.","severity":"breaking","affected_versions":">=2025.10.0"},{"fix":"Check network connectivity and verify API endpoint.","message":"The plugin only sends results on test session finish; it may fail silently if network is unavailable.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `pytest --mergify` instead of importing the module.","cause":"The package is installed but not imported correctly; it's a pytest plugin, not a direct import.","error":"ModuleNotFoundError: No module named 'pytest_mergify'"},{"fix":"Remove the CLI argument and set MERGIFY_TOKEN environment variable.","cause":"Using old API with `--mergify-token` where plugin expects env var.","error":"TypeError: __init__() got an unexpected keyword argument 'token'"},{"fix":"Run `pip install pytest-mergify` and ensure it's in the environment.","cause":"The plugin is not installed or not registered in pytest.","error":"pytest: error: unrecognized arguments: --mergify"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}