Skip to content

test: exclude optional plotting extra from coverage and unit-test _compute_extent - #13

Merged
jsteinberg34 merged 1 commit into
mainfrom
improve-coverage-reporting
Jun 25, 2026
Merged

test: exclude optional plotting extra from coverage and unit-test _compute_extent#13
jsteinberg34 merged 1 commit into
mainfrom
improve-coverage-reporting

Conversation

@jsteinberg34

Copy link
Copy Markdown
Owner

Summary

This is a small coverage-reporting cleanup, not new test logic. After Phases 1–4, every module except plotting.py sits at 76–100% coverage, but the headline number was a misleading 64% — because plotting.py (an optional visualization extra whose matplotlib/cartopy dependencies are not installed in CI) was being measured at ~5% and single-handedly dragging the total down. This PR makes the reported number reflect the code CI actually exercises, and adds a small real test for the one piece of plotting.py that contains pure logic.

What changes

  • pyproject.toml — exclude plotting.py from coverage measurement via omit = ["*/plotting.py"] under [tool.coverage.run], with a comment explaining why. plotting.py is an optional extra (pip install groundtrack[plotting]); its matplotlib/cartopy dependencies are intentionally not installed in CI, so its statements cannot be fairly measured there. The plot_* functions are thin cartopy/matplotlib wrappers that end in plt.show() — there is no meaningful logic to assert without brittle image-comparison tests, and a broken plot is immediately visible to the user rather than silently corrupting scientific output.
  • tests/test_plotting.py — add 6 unit tests for _compute_extent, the only pure function in plotting.py (it computes the map bounding box from track/station coordinates using numpy + wrap_lon_deg, and imports fine without matplotlib/cartopy). Covers the global fallback, padding, custom pad, stations-only, combined track+stations, and longitude wrapping. So the omitted module is not literally untouched — its one piece of real logic is verified.

Effect on coverage

Coverage
Before (with plotting.py) 64%
After (plotting.py omitted) ~87%

This is reporting only — no production code changed, and the omitted module's only logic is now tested. Every CI-exercised module remains at 76–100%.

Testing

pytest          # 118 passed, fully offline

@jsteinberg34 jsteinberg34 self-assigned this Jun 25, 2026
@jsteinberg34 jsteinberg34 added the enhancement New feature or request label Jun 25, 2026
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@jsteinberg34
jsteinberg34 merged commit 00fa255 into main Jun 25, 2026
5 checks passed
@jsteinberg34
jsteinberg34 deleted the improve-coverage-reporting branch June 25, 2026 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant