Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest: improve branch coverage #2501

Open
adamjstewart opened this issue Jan 5, 2025 · 0 comments
Open

pytest: improve branch coverage #2501

adamjstewart opened this issue Jan 5, 2025 · 0 comments
Labels
good first issue A good issue for a new contributor to work on testing Continuous integration testing

Comments

@adamjstewart
Copy link
Collaborator

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

@adamjstewart adamjstewart added good first issue A good issue for a new contributor to work on testing Continuous integration testing labels Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good issue for a new contributor to work on testing Continuous integration testing
Projects
None yet
Development

No branches or pull requests

1 participant