Skip to content

Commit f0ac76f

Browse files
committed
fix: configure coverage to report correct metrics
Added coverage configuration to pyproject.toml to properly track source files in src/ layout. Updated CI workflow to use coverage settings from pyproject.toml instead of inline parameters. This fixes the issue where Codecov was showing 0% coverage despite having 85% actual test coverage.
1 parent 3a391ec commit f0ac76f

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
4040
- name: Run tests
4141
run: |
42-
pytest tests/ -v --cov=bpm_detector --cov-report=xml
42+
pytest tests/ -v --cov --cov-report=xml
4343
4444
- name: Upload coverage reports to Codecov
4545
uses: codecov/codecov-action@v5

pyproject.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,24 @@ force_grid_wrap = 0
119119
use_parentheses = true
120120
ensure_newline_before_comments = true
121121

122+
[tool.coverage.run]
123+
source = ["src"]
124+
omit = [
125+
"*/tests/*",
126+
"*/test_*",
127+
]
128+
129+
[tool.coverage.report]
130+
exclude_lines = [
131+
"pragma: no cover",
132+
"def __repr__",
133+
"raise AssertionError",
134+
"raise NotImplementedError",
135+
"if __name__ == .__main__.:",
136+
"if TYPE_CHECKING:",
137+
"if typing.TYPE_CHECKING:",
138+
]
139+
122140
[tool.mypy]
123141
python_version = "3.8"
124142
warn_return_any = false

0 commit comments

Comments
 (0)