ci: changed testing to use coverage instead of pytest-cov #7
@@ -99,4 +99,11 @@ jobs:
|
||||
|
||||
- name: Run Pytest with Coverage
|
||||
id: coverage
|
||||
run: pytest --random-order --cov=./xil_bec --cov-config=./xil_bec/pyproject.toml --cov-branch --cov-report=xml --no-cov-on-fail ./xil_bec/tests/ || test $? -eq 5
|
||||
shell: bash
|
||||
# Uses the plain `coverage` CLI (pytest-cov is not a dependency anymore).
|
||||
# `|| test $? -eq 5` keeps an empty test collection from failing the job.
|
||||
run: |
|
||||
cd ./xil_bec
|
||||
coverage run --branch --source=./xil_bec -m pytest --random-order ./tests/ || test $? -eq 5
|
||||
coverage report
|
||||
coverage xml -o coverage.xml
|
||||
|
||||
@@ -55,6 +55,17 @@ plugin_widgets_update = "xil_bec.bec_widgets.auto_updates"
|
||||
[project.entry-points."bec.widgets.user_widgets"]
|
||||
plugin_widgets = "xil_bec.bec_widgets.widgets"
|
||||
|
||||
[tool.coverage.report]
|
||||
skip_empty = true # exclude empty *files*, e.g. __init__.py, from the report
|
||||
exclude_lines = [
|
||||
"pragma: no cover",
|
||||
"if TYPE_CHECKING:",
|
||||
"return NotImplemented",
|
||||
"raise NotImplementedError",
|
||||
"\\.\\.\\.",
|
||||
'if __name__ == "__main__":',
|
||||
]
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
include = ["*"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user