--- id: pytest-sentry version: "0.5.1" license: BSD-2-Clause license_treatment: permissive maintenance: aging --- # pytest-sentry — A pytest plugin to send testrun information to Sentry.io License: permissive · Maintenance: aging · Downloads: 80.4K/mo ## What it is and what it does pytest-sentry is a pytest plugin that integrates with Sentry to track and aggregate test run data. It is designed to work alongside pytest-rerunfailures to capture flaky test failures—tests that fail intermittently but pass on retry—and report them to Sentry without breaking the CI build. By default, only flaky tests are reported; consistently failing tests are not sent, and consistently passing tests generate no errors. The plugin also sends performance data to Sentry by default, tracking fixture setup times and test execution times as separate transactions within a trace. This lets you identify slow fixtures and large tests. Configuration is entirely environment-variable driven (PYTEST_SENTRY_DSN, PYTEST_SENTRY_TRACES_SAMPLE_RATE, etc.), with optional per-test overrides via pytest markers. The plugin maintains strict isolation between its own Sentry client and any Sentry SDK usage in the code being tested, to avoid quota waste from expected errors in the application. Use it for: - Track flaky tests in CI that are hidden by automatic retry plugins, keeping visibility without breaking builds. - Identify slow test fixtures and test functions by sending performance transactions to Sentry. - Report all test failures on specific branches (e.g., main) by setting PYTEST_SENTRY_ALWAYS_REPORT=1. - Correlate test failures with CI metadata (branch, commit, environment) using Sentry's tagging system. - Disable Sentry reporting for specific tests using pytest markers when you want to exclude certain test runs. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that sends test failure and performance data to Sentry, with special handling for flaky tests detected via pytest-rerunfailures. Yes, if you use pytest-rerunfailures and want visibility into flaky test patterns without cluttering your CI status. The low install friction and permissive license make adoption straightforward. However, note that the package is aging (409 days since last release); verify compatibility with your current pytest and sentry-sdk versions before relying on it in production CI. ## Install pip install pytest-sentry uv add pytest-sentry poetry add pytest-sentry ## Installing pytest-sentry Before you install: Low friction install with three runtime dependencies (pytest, sentry-sdk, wrapt). Maintenance status is aging—last release was 409 days ago, though the repository remains active and not archived. License in practice: BSD-2-Clause is permissive; you can use this in commercial or proprietary projects with minimal restrictions, provided you include the license text. Quickstart: pip install pytest-sentry export PYTEST_SENTRY_DSN="https://xx@xxx.ingest.sentry.io/xxx" export PYTEST_SENTRY_TRACES_SAMPLE_RATE=1 pytest --reruns=5 Requires pytest-rerunfailures plugin to be installed and enabled for flaky test detection to work as intended. Verify before relying: - Whether the aging maintenance status (409 days since last release) affects compatibility with recent pytest or sentry-sdk versions. - Performance overhead of transaction reporting in large test suites and whether sampling rates are sufficient to manage quota. ## Package facts - License: BSD-2-Clause (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 80.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest sentry integration, flaky test tracking, test failure reporting, pytest performance monitoring, sentry test plugin, ci test aggregation, pytest error reporting, test-monitoring, ci-integration, flaky-test-tracking [View on SkillFed](https://skillfed.io/packages/pytest-sentry) · [View on PyPI](https://pypi.org/project/pytest-sentry/)