Description
By default, coverage only reports which lines were executed during unit testing. By enabling branch coverage, we can also see whether if-statements are tested for both True and False conditions.
To enable this, simply add the following to pyproject.toml
:
[tool.coverage.run]
branch = true
https://app.codecov.io/gh/microsoft/torchgeo/pull/2276/indirect-changes gives an idea of places where this coverage is missing. The real work involves adding new tests to add the missing coverage.
Reference: https://coverage.readthedocs.io/en/latest/branch.html
@isaaccorley edit -- We've had several PRs simply changing the above line is pyproject.toml
, however the end goal of this issue is to not only change this line but also fix the missing branch tests so we obtain 100% code coverage. Please consider this effort when contributing a PR for this.