# DeprecationWarning: @pytest.yield_fixture is deprecated. Use @pytest.fixture instead; they are the same.

- **ID:** `python/pytest-deprecation-yield-fixture`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Since pytest 3.0, yield_fixture is an alias of fixture. In pytest 7+ the alias emits a DeprecationWarning and will be removed.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 7.x | active | — | — |
| 8.x | active | — | — |

## Workarounds

1. **** (98% success)
   ```
   # before
@pytest.yield_fixture
def client(): ...

# after
@pytest.fixture
def client(): ...
   ```
2. **** (90% success)
   ```
   pyupgrade --py38-plus tests/**/*.py
   ```

## Dead Ends

- **** — Hides the warning but leaves the deprecated API in place; the fixture will break on the next major release. (70% fail)
- **** — Blocks upgrades and security patches across the whole test toolchain. (65% fail)
