From fb5b160b923811ee48632fb8be37411b1f1352c4 Mon Sep 17 00:00:00 2001 From: John Sharples Date: Tue, 17 Oct 2023 10:15:36 +1100 Subject: [PATCH] 73: update .toml to enable pytest-cov report --- .github/workflows/python-app.yml | 10 ++++++---- pyproject.toml | 12 ++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 3f0517bf0..d02955dd5 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -5,9 +5,9 @@ name: Unit Tests on: push: - branches: ["develop", "main"] + branches: ["develop", "main", "[0-9]+-*"] pull_request: - branches: ["develop", "main"] + branches: ["develop", "main", "[0-9]+-*"] permissions: contents: read @@ -34,5 +34,7 @@ jobs: - name: Test with pytest run: | pip install pytest pytest-cov - pytest --cov-report html --cov=src --junitxml=junit/test-results.xml --junitxml=junit/test-results.xml - + coverage run -m pytest + - name: Report test coverage + run: | + coverage report -m diff --git a/pyproject.toml b/pyproject.toml index 661c2f4df..5fd2fe195 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,7 @@ dev = [ "mypy == 1.3.0", "pylint == 2.17.4", "dask", + "h5netcdf", "pandas-stubs" ] tutorial = [ @@ -78,3 +79,14 @@ warn_unused_configs = true [[tool.mypy.overrides]] ignore_missing_imports = true + +[tool.coverage.paths] +source = ["/src/"] + +[tool.pytest.ini_options] +addopts = [ + '--cov-fail-under=98', + '--cov-report=html', + '--cov-report=term-missing', + '--junitxml=report.xml' +]