Skip to content

Commit 0d2672a

Browse files
committed
Add 100% clean coverage
1 parent 47d35f0 commit 0d2672a

File tree

4 files changed

+555
-318
lines changed

4 files changed

+555
-318
lines changed

.github/workflows/shared.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
version: 0.7.2
5050

5151
- name: Install the project
52-
run: uv sync --frozen --all-extras --python ${{ matrix.python-version }} --resolution ${{ matrix.dep-resolution }}
52+
run: uv sync --all-extras --python ${{ matrix.python-version }} --resolution ${{ matrix.dep-resolution }}
5353

5454
- name: Run pytest
5555
run: uv run --frozen --no-sync pytest

pyproject.toml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ dev = [
5959
"pytest-pretty>=1.2.0",
6060
"inline-snapshot>=0.23.0",
6161
"dirty-equals>=0.9.0",
62+
"coverage[toml]>7.10.3",
6263
]
6364
docs = [
6465
"mkdocs>=1.6.1",
@@ -124,11 +125,6 @@ mcp = { workspace = true }
124125
[tool.pytest.ini_options]
125126
log_cli = true
126127
xfail_strict = true
127-
addopts = """
128-
--color=yes
129-
--capture=fd
130-
--numprocesses auto
131-
"""
132128
filterwarnings = [
133129
"error",
134130
# This should be fixed on Uvicorn's side.
@@ -148,3 +144,24 @@ MD029=false # ol-prefix - Ordered list item prefix
148144
MD033=false # no-inline-html Inline HTML
149145
MD041=false # first-line-heading/first-line-h1
150146
MD059=false # descriptive-link-text
147+
148+
# https://coverage.readthedocs.io/en/latest/config.html#run
149+
[tool.coverage.run]
150+
brach = true
151+
patch = ["subprocess"]
152+
concurrency = ["multiprocessing", "thread"]
153+
source = ["src", "tests"]
154+
155+
# https://coverage.readthedocs.io/en/latest/config.html#report
156+
[tool.coverage.report]
157+
fail_under = 100
158+
skip_covered = true
159+
show_missing = true
160+
ignore_errors = true
161+
precision = 2
162+
exclude_lines = [
163+
"pragma: no cover",
164+
"if TYPE_CHECKING:",
165+
"@overload",
166+
"raise NotImplementedError",
167+
]

scripts/test

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
uv run coverage run -m pytest -n auto $@
6+
uv run coverage combine
7+
uv run coverage report

0 commit comments

Comments
 (0)