# PytestWarning: Slow test detected: test_heavy_computation took 5.23s

- **ID:** `python/pytest-slow-test-warning`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The pytest-slow-test plugin or a custom hook flags a test that exceeds a time threshold. This is a warning, not an error, but may be treated as an error if warnings are errors.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   Use smaller datasets, mock heavy operations, or use caching.
   ```
2. **** (90% success)
   ```
   @pytest.mark.slow
def test_heavy_computation():
    ...
Run with: pytest -m 'not slow'
   ```
3. **** (85% success)
   ```
   @pytest.mark.slow_test_threshold(10)
def test_heavy_computation():
    ...
   ```

## Dead Ends

- **** — This reduces coverage and may remove important test cases. (90% fail)
- **** — This masks the performance issue and may allow very slow tests to persist. (80% fail)
- **** — If warnings are errors, the test suite still fails. (70% fail)
