# AssertionError: Dependency overrides not applied: response still uses production DB

- **ID:** `python/fastapi-dependency-override-not-applied`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Using `app.dependency_overrides` on a different app instance than the one under test, or not clearing overrides after.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 0.100.x | active | — | — |
| 0.110.x | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   client = TestClient(app)\napp.dependency_overrides[get_db] = fake_db
   ```
2. **** (93% success)
   ```
   @pytest.fixture\ndef client():\n    yield TestClient(app)\n    app.dependency_overrides.clear()
   ```

## Dead Ends

- **** — If the TestClient uses a different app, overrides never apply. (70% fail)
- **** — FastAPI resolves via dependency_overrides, not module lookup. (80% fail)
