Skip to content

test+build: Django --since coverage; drop pytest-cov trap#95

Merged
croc100 merged 2 commits into
mainfrom
test/coverage-gaps-v1.7
Jul 13, 2026
Merged

test+build: Django --since coverage; drop pytest-cov trap#95
croc100 merged 2 commits into
mainfrom
test/coverage-gaps-v1.7

Conversation

@croc100

@croc100 croc100 commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

Two related coverage-quality changes.

1. Cover Django --since / --min-revision scoping

_django_migrations_since (dependency-graph logic behind mrt check --since/--min-revision for Django) had zero tests despite being shipped. Adds five tests: transitive-dependent selection, root selection, unknown-revision, since ∩ min_revision intersection, and min_revision alone.

2. Replace pytest-cov dev dep with coverage

pytest-cov was never used — CI and CONTRIBUTING.md already measure via coverage run -m pytest. Keeping it invited pytest --cov, which under-reports coverage (~81% vs real ~91%): pytest_mrt is a pytest plugin imported before pytest-cov starts measuring, so all module-level code reads as uncovered. Swapping to coverage makes a plain .[dev] install ship the right tool; also drops now-redundant coverage installs from the DB CI jobs.

Coverage

  • adapters/django_detector.py: 76% → 86%
  • Total: 90% → 91%

475 passed locally via coverage run -m pytest.

croc100 added 2 commits July 14, 2026 04:20
The _django_migrations_since dependency-graph logic (Django --since and
--min-revision CLI scoping) had no test coverage. Add five tests exercising
transitive-dependent selection, root selection, unknown-revision handling,
and since/min_revision intersection.

Raises django_detector.py from 76% to 86% and total coverage to 91%.
pytest-cov is never used — CI and CONTRIBUTING.md already measure coverage
via 'coverage run -m pytest'. Keeping pytest-cov in dev deps invited
'pytest --cov', which under-reports coverage (~81% vs real ~91%): pytest_mrt
is a pytest plugin imported before pytest-cov starts measuring, so all
module-level code reads as uncovered. Swap it for 'coverage' so a plain
'.[dev]' install ships the correct tool, and drop the now-redundant
'coverage' installs from the DB CI jobs.
@croc100 croc100 changed the title test: cover Django --since/--min-revision dependency-graph scoping test+build: Django --since coverage; drop pytest-cov trap Jul 13, 2026
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@croc100
croc100 merged commit ff26649 into main Jul 13, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants