You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(ci): hit 100% coverage on the new is_otel_installed probe
CI failed across all Python versions because the new try/except branch in
import_checker.py (`except PackageNotFoundError: is_otel_installed = False`)
is unreachable under `--all-extras` — opentelemetry-api IS installed, so
the False branch never runs at module load time. Same gap for the new
test's `else` cleanup branch.
Two fixes that satisfy the project's 100% coverage rule:
- Extract the probe into `_is_distribution_installed(name)` helper. Two
new unit tests cover both branches: monkeypatch distribution() to raise
PackageNotFoundError (False path); call against opentelemetry-api which
IS installed (True path).
- Rewrite the existing partial-install test to use `monkeypatch.setitem`
instead of manual save/restore — no else branch needed.
The source-pinning assertion (regression guard against revert to find_spec
on the namespace) split into two simple `in` checks to satisfy PT018.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments