# pytest.PytestConfigWarning: conftest.py not found in 'tests/'

- **ID:** `python/pytest-conftest-not-found`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

pytest expects a conftest.py file in the test directory for shared fixtures and hooks, but it is missing, which may cause fixture resolution failures if tests rely on conftest-defined fixtures.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 7.0.0 | active | — | — |
| 8.0.0 | active | — | — |

## Workarounds

1. **Create a proper conftest.py file with the necessary fixtures and hooks** (95% success)
   ```
   In the tests/ directory, create conftest.py:
import pytest

@pytest.fixture
def shared_fixture():
    return 'data'
Then tests can use 'shared_fixture' without importing.
   ```
2. **Specify a custom conftest path using pytest's --confcutdir option** (70% success)
   ```
   pytest --confcutdir=tests/ tests/
This tells pytest to look for conftest only in the tests/ directory.
   ```

## Dead Ends

- **Creating an empty conftest.py file without any content** — This suppresses the warning but does not provide the necessary fixtures, causing test failures later. (50% fail)
- **Moving all fixtures to each individual test file** — This duplicates code and reduces maintainability, but may resolve the immediate warning. (30% fail)
