Skip to content

Commit 531983f

Browse files
authored
Run coverage in CI with % check of coverage. (#1945)
1 parent f7fff09 commit 531983f

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
- name: pytest
104104
run: |
105105
env
106-
pytest -v --full-trace --timeout=1200
106+
pytest -v --cov --full-trace --timeout=1200
107107
108108
analyze:
109109
name: Analyze Python

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ build/
1717
/pymodbus.egg-info/
1818
venv
1919
downloaded_files/
20+
htmlcov/

pyproject.toml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ asyncio_mode = "auto"
225225
timeout = 40
226226

227227
[tool.coverage.run]
228-
include = [
228+
source = [
229229
"examples/",
230230
"pymodbus/",
231231
"test/",
@@ -235,10 +235,15 @@ omit = ["examples/contrib/"]
235235
[tool.coverage.report]
236236
exclude_lines = [
237237
"_check_system_health",
238-
"if __name__ == .__main__.:",
238+
"__main__",
239239
]
240+
skip_covered = true
241+
fail_under = 86.0
242+
243+
[tool.coverage.html]
244+
directory = "htmlcov"
245+
skip_covered = true
240246

241-
ignore_errors = true
242247

243248
[tool.codespell]
244249
skip = "./build,./doc/source/_static,venv,.venv,.git,htmlcov,CHANGELOG.rst,.mypy_cache"

0 commit comments

Comments
 (0)