Add test coverage reporting and pre-commit hooks (#2)

* Add test coverage reporting and pre-commit hooks

- Add pytest-cov to test dependencies, configure coverage in pyproject.toml
  (branch coverage, static asset omission, standard exclusion patterns)
- CI test job now runs with --cov and uploads coverage XML as artifact
- Add .pre-commit-config.yaml with ruff (check + format) and mypy hooks

Baseline coverage: 41% (482 tests, Python 3.13)

* Fix Copilot review: add redis dep for pre-commit mypy, explicit --cov target

- Add redis>=7.2 to mypy pre-commit hook additional_dependencies so
  mypy can resolve redis imports in isolated pre-commit environments
- Use --cov=turnstone instead of bare --cov to explicitly scope coverage
This commit is contained in:
Patrick Buckley
2026-03-02 17:28:50 -08:00
committed by GitHub
parent 9be155b97a
commit c39affbf6b
3 changed files with 38 additions and 2 deletions
+6 -1
View File
@@ -40,4 +40,9 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- run: pip install -e ".[test,mq]"
- run: pytest tests/ -m "not live" -q
- run: pytest tests/ -m "not live" --cov=turnstone --cov-report=term-missing --cov-report=xml -q
- uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-${{ matrix.python-version }}
path: coverage.xml