Skip to content

Commit b290877

Browse files
chore: add coverage reporting to pytest
Add `pytest-cov` to `requirements-dev.txt` and enable coverage reporting in `run_tests.py` by including `--cov` and `--cov- report=xml` options. This provides insight into code coverage, helping to identify areas lacking test coverage.
1 parent 847d33d commit b290877

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
python run_tests.py
3838
3939
- name: Upload coverage to Codecov
40-
if: matrix.python-version == '3.11'
40+
if: matrix.python-version == '3.12'
4141
uses: codecov/codecov-action@v5
4242
with:
4343
files: ./coverage.xml

run_tests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ def run_tests():
2525
"custom_components/custom_areas/tests/",
2626
"-v",
2727
"--tb=short",
28+
"--cov=custom_components/custom_areas",
29+
"--cov-report=xml",
2830
],
2931
capture_output=True,
3032
text=True,

0 commit comments

Comments
 (0)