Skip to content

Commit 8e2d776

Browse files
author
Sin-Woo Bang
committed
Add code coverage
1 parent c22c839 commit 8e2d776

4 files changed

Lines changed: 158 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ jobs:
3535
- name: Run mypy
3636
run: uv run mypy src/
3737

38-
- name: Run tests
39-
run: uv run pytest -v
38+
- name: Run tests with coverage
39+
run: uv run pytest --cov=langdiff --cov-fail-under=75

CLAUDE.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ uv run pytest -v # Verbose output
2525
uv run pytest -k "test_name" # Run specific test by name pattern
2626
```
2727

28+
### Code Coverage
29+
```bash
30+
uv run pytest --cov=langdiff --cov-fail-under=75 # Run tests with 75% coverage requirement
31+
uv run pytest --cov=langdiff --cov-report=term-missing # Show missing lines in detail
32+
uv run pytest --cov=langdiff # Basic coverage report
33+
```
34+
2835
### Linting and Formatting
2936
```bash
3037
uv run ruff check # Check for linting issues
@@ -100,4 +107,4 @@ Development dependencies:
100107
Documentation dependencies:
101108
- `mkdocs`: Static site generator
102109
- `mkdocs-material`: Material Design theme for MkDocs
103-
- `mkdocstrings[python]`: Auto-generate API docs from docstrings
110+
- `mkdocstrings[python]`: Auto-generate API docs from docstrings

pyproject.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,23 @@ dev = [
3737
"mypy>=1.17.1",
3838
"openai>=1.99.1",
3939
"pytest>=8.4.1",
40+
"pytest-cov>=6.2.1",
4041
"ruff>=0.12.8",
4142
]
4243
docs = [
4344
"mkdocs>=1.6.0",
4445
"mkdocs-material>=9.5.0",
4546
"mkdocstrings[python]>=0.26.0",
4647
]
48+
49+
[tool.coverage.run]
50+
source = ["src"]
51+
omit = ["tests/*"]
52+
53+
[tool.coverage.report]
54+
exclude_lines = [
55+
"pragma: no cover",
56+
"def __repr__",
57+
"raise AssertionError",
58+
"raise NotImplementedError",
59+
]

0 commit comments

Comments
 (0)