From 34e7dff17da272abe175afee23614818c8c1ce37 Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Wed, 12 Aug 2026 17:34:33 +0200 Subject: [PATCH] ci: pytest-cov migrated to coverage --- .gitea/workflows/ci.yml | 7 ++++++- pyproject.toml | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 554e591..a3ad61a 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -91,4 +91,9 @@ jobs: - name: Run Pytest with Coverage id: coverage - run: pytest --random-order --cov=./csaxs_bec --cov-config=./csaxs_bec/pyproject.toml --cov-branch --cov-report=xml --no-cov-on-fail ./csaxs_bec/tests/ || test $? -eq 5 + shell: bash + run: | + cd ./csaxs_bec + coverage run --branch --source=./csaxs_bec -m pytest --random-order ./tests/ || test $? -eq 5 + coverage report + coverage xml -o coverage.xml diff --git a/pyproject.toml b/pyproject.toml index e8e6c23..c365e2e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,6 +87,17 @@ plugin_widgets_update = "csaxs_bec.bec_widgets.auto_updates" [project.entry-points."bec.widgets.user_widgets"] plugin_widgets = "csaxs_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 = ["*"]