# CoverageWarning: Module myapp was never imported. (module-not-imported)

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

## Root Cause

pytest-cov was invoked with --cov=myapp but the package was never imported during the test session, often because tests import a differently named package or the source path is wrong.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 4.x | active | — | — |
| 5.x | active | — | — |
| 6.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   pytest --cov=myapp --cov-report=term-missing tests/
   ```
2. **** (88% success)
   ```
   # .coveragerc
[run]
source = src/myapp
   ```

## Dead Ends

- **** — Changes the report format only; the module is still never imported so coverage stays at 0%. (80% fail)
- **** — Marks the module as imported but bypasses the real code paths, producing misleading 100% coverage on empty lines. (70% fail)
