# UsageError: @pytest.mark.usefixtures with unknown fixture 'nonexistent_fixture'

- **ID:** `python/pytest-mark-usefixtures-error`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The fixture name specified in @pytest.mark.usefixtures does not exist in any conftest.py or test file.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.9 | active | — | — |
| 3.10 | active | — | — |

## Workarounds

1. **Define the missing fixture in the test file or conftest.py.** (95% success)
   ```
   @pytest.fixture
def nonexistent_fixture(): return 'value'
   ```
2. **Correct the fixture name to match an existing fixture.** (90% success)
   ```
   @pytest.mark.usefixtures('existing_fixture')
   ```

## Dead Ends

- **Adding a fixture with the same name but wrong scope** — The fixture must be defined and accessible; scope mismatch may still cause errors. (60% fail)
- **Removing the usefixtures marker entirely** — If the fixture is required for test setup, tests may fail due to missing dependencies. (70% fail)
