Skip to content

DX: increase test coverage to 85%#621

Merged
redeboer merged 22 commits into
mainfrom
DX/test-coverage
Jun 27, 2026
Merged

DX: increase test coverage to 85%#621
redeboer merged 22 commits into
mainfrom
DX/test-coverage

Conversation

@redeboer

@redeboer redeboer commented Jun 23, 2026

Copy link
Copy Markdown
Member

Closes #615

🖱️ Developer experience

  • Greatly expand the test suite across the package: new or rewritten tests for the python checks (pyproject, ruff, pytest, ty, pyright, black, mypy, pyupgrade), the env/uv, format (precommit, prettier, toml, cspell), github/workflows, nb/binder, readthedocs, and repo (poe, citation, commitlint, deprecated) modules, plus the cli, gitpod, and pixi checks.
  • Rewrite the tests to use pytest-describe for grouped, readable test blocks, and add it to the test dependency group.
  • Raise the coverage gate from --cov-fail-under=33 to 85 and the Codecov project target from 33% to 85% so the new coverage is enforced.
  • Disable branch coverage (branch = false and branch-coverage = false) so the gate tracks line coverage only.
  • Avoid writing to the real working directory from the test suite, isolating tests on disk.
  • Add a doctest to __has_uv_run documenting its behaviour for both string and sequence commands.

🐛 Bug fixes

  • cspell: compare against original_config.get(section_name) in _update_config_content so that newly added sections no longer raise a KeyError.
  • pyright / ty: run all configuration updates through a single Executor so every update is applied in one pass instead of bailing out on the first reported change.

Squash commit messages

* DX: avoid using IO in tests directory
* DX: disable branch coverage
* DX: rewrite tests to use `pytest-describe`
* FIX: apply all `ty`/`pyright` updates in one pass
* FIX: handle new sections in `_update_config_content`

redeboer added 17 commits June 22, 2026 16:38
* DX: increase minimal test coverage to 39%
* DX: increase test coverage to 52%
* DX: increase test coverage to 56%
* DX: increase test coverage to 59%
* DX: increase test coverage to 62%
* DX: increase test coverage to 65%
* DX: increase test coverage to 67%
* DX: increase test coverage to 68%
The `fixed_sections` generator indexed `original_config[section_name]`,
which raised `KeyError` when the template adds a section absent from the
original config (e.g. starting from an empty `.cspell.json`).
* DX: increase test coverage to 70%
* DX: increase test coverage to 72%
* DX: increase test coverage to 81%
* DX: increase test coverage to 83%
Route every sub-step in `ty.main`/`pyright.main` (and their
`_update_vscode_settings` helpers) through an `Executor`, as the other
check modules already do. Previously the functions called each fallible
step directly, so the first `PrecommitError` (e.g. the initial VS Code
change) aborted the `with` body and was swallowed by the empty-changelog
`ModifiablePyproject` context. That made the config, dependency, and
pre-commit updates land only on later runs; they now all apply at once.
@redeboer redeboer added this to the 0.9.0 milestone Jun 23, 2026
@redeboer redeboer self-assigned this Jun 23, 2026
@redeboer redeboer added 🖱️ DX Improvements to the Developer Experience 🐛 Bug Something isn't working 🔨 Maintenance Maintenance and upkeep improvements and removed 🔨 Maintenance Maintenance and upkeep improvements labels Jun 23, 2026
* FIX: remove comitted Codex configuration
@redeboer redeboer marked this pull request as ready for review June 23, 2026 15:52
@redeboer redeboer changed the title DX: reorganise tests and increase coverage DX: increase test coverage to 85% Jun 23, 2026
@redeboer redeboer merged commit 3bc7dc3 into main Jun 27, 2026
22 checks passed
@redeboer redeboer deleted the DX/test-coverage branch June 27, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 Bug Something isn't working 🖱️ DX Improvements to the Developer Experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Increase unit-test coverage of check modules

1 participant