# RecursionError: maximum recursion depth exceeded while calling a Python object in conftest.py

- **ID:** `python/pytest-conftest-recursion-error`
- **Domain:** python
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A fixture in conftest.py is calling itself recursively without a base case, often due to circular dependency or infinite loop in fixture setup.

## Version Compatibility

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

## Workarounds

1. **Identify and break the circular dependency by restructuring fixtures.** (85% success)
   ```
   Refactor conftest.py to avoid fixture A calling fixture B that calls fixture A again.
   ```
2. **Use 'yield' fixtures with proper teardown to avoid recursive setup.** (80% success)
   ```
   Change fixture to use yield instead of return to ensure cleanup breaks recursion.
   ```

## Dead Ends

- **Increasing recursion limit with sys.setrecursionlimit** — This only delays the crash; the infinite loop still exists and may exhaust memory. (70% fail)
- **Removing all fixtures from conftest.py** — Tests that depend on those fixtures will fail with missing fixture errors. (80% fail)
