# no tests ran in 0.00s
ERROR: file or directory not found: tests/

- **ID:** `python/pytest-exit-code-no-tests-collected`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The path passed to pytest does not exist relative to the current working directory. Often happens in CI when the working directory is the repo root but tests live in a sub-package, or when a Makefile changes directory.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Verify the path and use the full path:

pytest ./backend/tests
   ```
2. **** (95% success)
   ```
   Set testpaths in config so pytest finds the right directory regardless of cwd:

# pyproject.toml
[tool.pytest.ini_options]
testpaths = ["backend/tests"]
   ```

## Dead Ends

- **** — May collect unrelated tests or fail to find anything if rootdir is misconfigured. (50% fail)
- **** — Silences the error but runs zero tests, causing CI to pass green with no coverage. (90% fail)
