# ScopeMismatch: You tried to access the function scoped fixture db with a session scoped request object

- **ID:** `python/pytest-scope-mismatch`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A session-scoped fixture depends on a function-scoped fixture, which is not allowed because the session fixture outlives the function fixture.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   Promote the dependency to a compatible scope:
@pytest.fixture(scope='session')
def db():
    ...
   ```
2. **** (88% success)
   ```
   Or demote the dependent fixture to function scope:
@pytest.fixture(scope='function')
def client(db):
    ...
   ```

## Dead Ends

- **** — Defaults to function scope, which is the same problem. (60% fail)
- **** — Does not change scope compatibility. (70% fail)
