# CoverageWarning: No data was collected. (no-data-collected)
  warnings.warn("No data was collected.", CoverageWarning)

- **ID:** `python/pytest-cov-no-data-collected-warning`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

coverage was started but never stopped, or the source path passed to `--cov` does not match any imported module. Common when tests import a different installed copy of the package than the one in CWD, or when `--cov=src` doesn't exist.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (93% success)
   ```
   pip install -e .
pytest --cov=myapp --cov-report=term-missing
# or
pytest --cov=src/myapp
   ```
2. **** (90% success)
   ```
   # pyproject.toml
[tool.coverage.run]
source = ["myapp"]

[tool.pytest.ini_options]
addopts = "--cov --cov-report=term-missing"
   ```

## Dead Ends

- **** — The report has no data to display; it just prints an empty table. (70% fail)
- **** — Two coverage processes conflict; the .coverage file is corrupted or overwritten. (80% fail)
