# FileNotFoundError: [Errno 2] No such file or directory: '/repo/tests/test_parser/input.csv'

- **ID:** `python/pytest-datadir-missing-file`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

pytest-datadir resolves `data/` relative to the test module's directory; the file lives in the wrong path, the plugin is not installed, or the test file was moved without moving its data directory.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 0.8 | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   Place data next to the test as `tests/test_parser/input.csv` and reference it via the `datadir` fixture:
def test_parse(datadir):
    path = datadir / 'input.csv'
    assert path.exists()
   ```
2. **** (85% success)
   ```
   Or use `tmp_path` + `shutil.copy` from a committed fixtures dir:
import shutil
FIXTURES = Path(__file__).parent / 'fixtures'
def test_parse(tmp_path):
    src = FIXTURES / 'input.csv'
    dst = tmp_path / 'input.csv'
    shutil.copy(src, dst)
   ```

## Dead Ends

- **** — Breaks on CI and other machines; path does not exist there. (90% fail)
- **** — Silently produces empty fixtures and the test asserts against wrong data. (75% fail)
