# CoverageWarning: No contexts were measured
  warnings.warn("No contexts were measured")

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

## Root Cause

`--cov-context=test` was passed but the coverage config does not enable dynamic contexts, or the coverage version does not support the requested context mode.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   Enable dynamic contexts in coverage config:
# pyproject.toml
[tool.coverage.run]
dynamic_context = "test_function"
# then run:
pytest --cov=myapp --cov-context=test
   ```
2. **** (85% success)
   ```
   Or set the env var before running:
COVERAGE_DYNAMIC_CONTEXT=test_function pytest --cov=myapp --cov-context=test
   ```

## Dead Ends

- **** — Only affects the failure threshold; contexts still not measured. (85% fail)
- **** — Hides the warning but loses per-test coverage reporting that was the goal. (60% fail)
