{"id":21802,"library":"pytest-fail-slow","title":"pytest-fail-slow","description":"A pytest plugin that fails tests exceeding a configurable duration. v0.6.0 supports both marker-level and command-line slow time thresholds; actively maintained.","status":"active","version":"0.6.0","language":"python","source_language":"en","source_url":"https://github.com/jeffreyjackson/pytest-fail-slow","tags":["pytest","plugin","testing","performance","slow"],"install":[{"cmd":"pip install pytest-fail-slow","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"plugin requires pytest runtime","package":"pytest","optional":false}],"imports":[{"note":"decorator used to mark individual tests","wrong":"","symbol":"fail_slow","correct":"from pytest_fail_slow import fail_slow"}],"quickstart":{"code":"# conftest.py\npytest_plugins = ['pytest_fail_slow']\n# then in test\nimport pytest\nfrom pytest_fail_slow import fail_slow\n\n@fail_slow(0.5)\ndef test_fast_enough():\n    import time\n    time.sleep(0.1)\n    assert True","lang":"python","description":"Enable plugin and use @fail_slow decorator to set per-test maximum duration in seconds."},"warnings":[{"fix":"Place @fail_slow closest to the function, above other custom decorators.","message":"The @fail_slow decorator must be applied after @pytest.mark.slow or similar markers; order matters because the decorator reads the test's current marker info.","severity":"gotcha","affected_versions":"all"},{"fix":"Use the default pytest runner.","message":"The plugin only works with pytest's default runner; custom runners may silently ignore the fail_slow marker.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `--fail-slow-seconds <seconds>` from command line.","message":"The CLI option --fail-slow is deprecated in v0.6.0; use --fail-slow-seconds instead.","severity":"deprecated","affected_versions":">=0.6.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install pytest-fail-slow >=0.5.0: pip install --upgrade pytest-fail-slow","cause":"Older versions may not expose the decorator; or package not installed.","error":"ImportError: cannot import name 'fail_slow' from 'pytest_fail_slow'"},{"fix":"Use @fail_slow(2.0) not @fail_slow","cause":"Decorator called without parentheses or argument.","error":"TypeError: fail_slow() missing 1 required positional argument: 'seconds'"},{"fix":"Use `--fail-slow-seconds <value>` instead.","cause":"Using deprecated flag; plugin expects new flag.","error":"pytest: error: unrecognized arguments: --fail-slow"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}