{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/2"}],"enrichment":{"capability":"pytest-retry is a pytest plugin that automatically retries failed tests, with configurable retry counts, delays, and exception filtering to help manage flaky tests in CI environments.","skillfed_tags":["pytest-plugin","ci-resilience","flaky-tests"],"use_cases":["Retry all tests in a CI pipeline up to N times to reduce false negatives from transient environment issues.","Mark specific tests known to be flaky with @pytest.mark.flaky to retry only those without affecting the full suite.","Retry tests only when they fail with specific exceptions (e.g., network timeouts) while failing immediately on assertion errors.","Add delays between retry attempts to allow intermittent services or resources to recover.","Generate detailed reports of which tests were retried and why, to identify candidates for permanent fixes."],"what_it_does":"pytest-retry extends pytest with the ability to automatically re-run tests that fail, addressing the problem of flaky tests that pass inconsistently due to timing issues, external service delays, or environment race conditions. It works as a pytest plugin with two main modes: global retry settings applied to all tests via command-line flags (--retries, --retry-delay) or configuration files, and per-test control via the @pytest.mark.flaky decorator for fine-grained retry policies.\n\nThe plugin integrates into pytest's reporting flow to track and display retried tests separately. It supports exception filtering (retry only on specific exceptions or exclude certain ones), configurable timing methods (overwrite vs. cumulative), and custom outcome labels for compatibility with other reporting tools. Teardown steps run after each failed attempt to ensure clean state before retries, though fixture setup itself is not retried. The package is designed as a pragmatic short-term solution while permanent fixes are implemented, not a substitute for addressing root causes of flakiness.","worth_installing":"Yes, if you have flaky tests in CI and need a quick way to reduce false failures while you investigate root causes. The low install friction, permissive license, and absence of known vulnerabilities make it safe to add. Maintenance is dormant but recent, and the plugin's scope is narrow enough that stability is likely. Not recommended as a permanent solution\u2014use it to buy time while fixing the underlying test or environment issues."},"id":"pytest-retry","links":{"html":"https://skillfed.io/packages/pytest-retry","md":"https://skillfed.io/packages/pytest-retry.md","pypi":"https://pypi.org/project/pytest-retry/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2025-01-19","license_spdx":null,"license_treatment":"permissive","name":"pytest-retry","python_support":"supports_current","summary":"Adds the ability to retry flaky tests in CI environments"},"popularity":{"monthly_downloads":2588607,"position":2982,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.7.0"}
