# pytest-cache: no previously failed tests found

- **ID:** `python/pytest-cache-last-failed`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

When using pytest --lf (last failed) or --ff (first failed), no previous test run data is available in the cache, often because the cache file is missing or the test suite has not been run before.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 7.0.0 | active | — | — |
| 8.0.0 | active | — | — |

## Workarounds

1. **Run the full test suite first to populate the cache, then use --lf** (95% success)
   ```
   First run: pytest
Then run: pytest --lf
This will re-run only the tests that failed in the previous run.
   ```
2. **Use --co (cache-show) to inspect the cache contents** (80% success)
   ```
   Run: pytest --co
This shows the cached results. If empty, run the full suite first.
   ```

## Dead Ends

- **Running pytest --clear-cache to reset the cache** — This removes any existing cache, making the situation worse if there was data. (60% fail)
- **Manually creating a cache file with dummy data** — This is error-prone and may cause pytest to misbehave if the format is incorrect. (90% fail)
