{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/5"}],"enrichment":{"capability":"A pytest plugin that marks tests as failed if they exceed a specified duration threshold, either via per-test markers or a global command-line option.","skillfed_tags":["pytest-plugin","performance-testing","ci-enforcement"],"use_cases":["Enforce maximum test duration in CI pipelines to catch performance regressions before they reach production.","Mark tests that are intentionally slow (e.g., integration tests) with a higher threshold to distinguish them from unit tests.","Conditionally fail slow tests only in CI environments while allowing longer runs during local development.","Detect fixture setup overhead by monitoring setup duration separately from test execution time.","Apply a blanket duration limit across all tests via command-line option without modifying test code."],"what_it_does":"pytest-fail-slow is a pytest plugin that enforces test duration limits by marking tests as failed when they exceed a specified time threshold. It operates in two modes: you can apply a `fail_slow` marker to individual tests with a duration cutoff, or pass a `--fail-slow DURATION` option to pytest to apply a global cutoff to all unmarked tests. The plugin also supports a `fail_slow_setup` marker to fail tests if their fixture setup stages exceed a duration limit. Tests run to completion even when they exceed the threshold\u2014if you want to stop them early, the plugin documentation recommends pytest-timeout instead.\n\nThe plugin accepts durations in multiple units (seconds, milliseconds, hours, etc.) and supports conditional enabling via an `enabled` keyword argument, allowing you to apply different thresholds or disable checks based on environment variables or pytest configuration. It is actively maintained, supports Python 3.8 through 3.12 on both CPython and PyPy, and includes type hints.","worth_installing":"Yes. The plugin is lightweight, actively maintained, permissively licensed, and solves a concrete problem\u2014catching performance regressions in test suites. Install it if you need to enforce test duration limits in CI or detect slow tests without stopping them early."},"id":"pytest-fail-slow","links":{"html":"https://skillfed.io/packages/pytest-fail-slow","md":"https://skillfed.io/packages/pytest-fail-slow.md","pypi":"https://pypi.org/project/pytest-fail-slow/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2024-06-01","license_spdx":null,"license_treatment":"permissive","name":"pytest-fail-slow","python_support":"supports_current","summary":"Fail tests that take too long to run"},"popularity":{"monthly_downloads":176356,"position":10245,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.6.0"}
