From 0fa1ac3b696f7bfccdf78e5105964e8c0acdee5b Mon Sep 17 00:00:00 2001 From: ernestprovo23 Date: Mon, 8 Jun 2026 21:58:29 -0400 Subject: [PATCH] ci(coverage): add pytest-cov with 75% branch-coverage floor (PR-C) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Measured branch+statement coverage: 76% (cli.py has 0 coverage as it requires subprocess/invoke testing; transport.py error paths at 29%). Floor set to 75% — one point below measured — as a non-regression gate. - Add pytest-cov>=5.0.0 to dev extras in pyproject.toml - Add [tool.coverage.run] (branch=true, source=conclave) and [tool.coverage.report] (fail_under=75, show_missing=true) - Update test job to run with --cov=conclave --cov-report=term-missing --cov-fail-under=75 on every matrix leg --- .github/workflows/test.yml | 4 ++-- pyproject.toml | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 73af864..bd79caf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,8 +33,8 @@ jobs: - name: Install package with dev extras run: pip install -e ".[dev]" - - name: Run tests - run: pytest -q + - name: Run tests with coverage + run: pytest -q --cov=conclave --cov-report=term-missing --cov-fail-under=75 lint: name: "ruff" diff --git a/pyproject.toml b/pyproject.toml index 2dbb47d..d5132c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ dependencies = [ dev = [ "pytest>=8.0.0", "pytest-asyncio>=0.23.0", + "pytest-cov>=5.0.0", ] [project.scripts] @@ -37,6 +38,19 @@ asyncio_mode = "auto" testpaths = ["tests"] pythonpath = ["."] +[tool.coverage.run] +source = ["conclave"] +branch = true + +[tool.coverage.report] +fail_under = 75 +show_missing = true +exclude_lines = [ + "pragma: no cover", + "if TYPE_CHECKING:", + "raise NotImplementedError", +] + [tool.ruff] line-length = 100 target-version = "py311"