Skip to content

Commit 8dab473

Browse files
committed
Add hatch command for html coverage report
1 parent cef2b24 commit 8dab473

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/developers/contributing.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,13 @@ Both unit tests and docstring doctests are included when computing coverage. Run
190190

191191
$ hatch env run --env test.py3.12-2.1-optional run-coverage
192192

193-
will automatically run the test suite with coverage and produce a coverage report.
193+
will automatically run the test suite with coverage and produce a XML coverage report.
194194
This should be 100% before code can be accepted into the main code base.
195195

196+
You can also generate a HTML rendered of the coverage report by running::
197+
198+
$ hatch env run --env test.py3.12-2.1-optional run-coverage-html
199+
196200
When submitting a pull request, coverage will also be collected across all supported
197201
Python versions via the Codecov service, and will be reported back within the pull
198202
request. Codecov coverage must also be 100% before code can be accepted.

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,9 @@ features = ["gpu"]
149149
[tool.hatch.envs.test.scripts]
150150
run-coverage = "pytest --cov-config=pyproject.toml --cov=pkg --cov-report xml --cov=src --junitxml=junit.xml -o junit_family=legacy"
151151
run-coverage-gpu = "pip install cupy-cuda12x && pytest -m gpu --cov-config=pyproject.toml --cov=pkg --cov-report xml --cov=src --junitxml=junit.xml -o junit_family=legacy"
152+
run-coverage-html = "pytest --cov-config=pyproject.toml --cov=pkg --cov-report html --cov=src"
152153
run = "run-coverage --no-cov"
154+
run-pytest = "run"
153155
run-verbose = "run-coverage --verbose"
154156
run-mypy = "mypy src"
155157
run-hypothesis = "pytest --hypothesis-profile ci tests/test_properties.py tests/test_store/test_stateful*"

0 commit comments

Comments
 (0)