Mutation-test the lines each chunk changes in the stability pass
This commit is contained in:
@@ -77,6 +77,19 @@ Install puts only `loop-claude` on `PATH`; call the others by their path, such a
|
||||
|
||||
Test on the host, with `uv` on `PATH` to fetch mypy and the Python version Install names (`docs/decisions.md` → `bin/`): `python3 -m unittest discover -s bin -p 'test_*.py'`
|
||||
|
||||
Mutation-test a changed module, here `larv_review/rounds.py`, in a scratch copy of `bin/`, since mutmut writes files beside its config. Name the module and its tests in a `setup.cfg` there, and leave out each test that starts a tool's launcher: the launcher's Python has no mutmut.
|
||||
|
||||
```ini
|
||||
[mutmut]
|
||||
source_paths=larv_review/rounds.py
|
||||
also_copy=.
|
||||
pytest_add_cli_args_test_selection=larv_review/
|
||||
pytest_add_cli_args=-k
|
||||
not LarvReviewTool
|
||||
```
|
||||
|
||||
Then, in the copy: `uvx --with pytest mutmut run && uvx --with pytest mutmut results`, and `uvx --with pytest mutmut show <mutant>` for a mutant's line.
|
||||
|
||||
`bin/` is the import root: each launcher puts it on `sys.path`, so a module imports another by its path under `bin/`, such as `from claude_code.entries import parse_entry`. Each tool's package holds its tests; `rank_todo.py` and `statusline.py` are tools of one file each, tested beside them, and `rule_hook` imports `rank_todo.py`'s check. The other non-test modules at `bin/`'s root, `claude_code/` and `transcript_archive/` serve more than one tool. `test_env.py` serves the tests, and `repo_checks/` tests the repo itself.
|
||||
|
||||
## Tracking a new file
|
||||
|
||||
Reference in New Issue
Block a user