Commit 2408684
authored
fix: add real coverage measurement and direct-import tests (#6)
## Summary
The test suite was running scripts via subprocess, which meant
pytest-cov couldn't instrument them — **coverage was silently 0% while
the 90% threshold appeared to pass**. The quality gate this repo ships
to downstream repos was never enforced on itself.
- Make `scripts/` importable (add `__init__.py`, configure
`pythonpath=["."]`)
- Add `--cov=scripts --cov-report=term-missing` to `pyproject.toml`
addopts
- Add 79 direct-import tests across 3 new test files
- Allow `_find_project_root()` to accept an optional start path for
testability
## Coverage: 0% → 92%
| Script | Before | After |
|--------|--------|-------|
| check_lint.py | 0% | 98% |
| check_tests.py | 0% | 95% |
| check_types.py | 0% | 92% |
| check_package.py | 0% | 91% |
| qa.py | 0% | 91% |
| sync.py | 0% | 90% |
| check_spelling.py | 0% | 90% |
| check_security.py | 0% | 88% |
| **Total** | **0%** | **92%** |
## Test plan
- [x] 79 new direct-import tests all pass locally
- [x] Lint and format clean
- [x] Coverage threshold (90%) now actually enforced
- [x] Existing subprocess smoke tests preserved for CI integration
coverage1 parent 3cc88f0 commit 2408684
File tree
6 files changed
+1021
-5
lines changed- scripts
- tests
6 files changed
+1021
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
Whitespace-only changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
0 commit comments