Skip to content

Measure test coverage of Numba jit-compiled code - #724

Draft
santisoler wants to merge 9 commits into
mainfrom
numba-coverage
Draft

santisoler wants to merge 9 commits into
mainfrom
numba-coverage

Conversation

@santisoler

@santisoler santisoler commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Reduce tests to a single run of pytest with NUMBA_JIT_COVERAGE enabled, so Numba can track coverage through JIT compiled functions. However, branch analysis doesn't work properly and has to be disable by a comment # pragma: no branch on every for, if, etc. Still this is better than running the tests twice every time. Replace the rules in the Makefile. Add a section to the Contributing Guide explaining why we have all the pragma comments.

Relevant issues/PRs: Inspired by fatiando/choclo#211

Have you used generative AI tools to develop this PR?

  • Yes (please explain below to what extent and how it was used).
  • No.

Configure pytest in the `Makefile` and `pyproject.toml` to track down
test coverage within Numba functions.
Remove the now obsolete `run_only_with_numba` decorator. Get rid of
the `pytest.mark.use_numba` mark since we don't need it anymore. Remove
the `pragma` comments that were intended to ignore coverage within test
functions that were only run with Numba enabled.
@santisoler

Copy link
Copy Markdown
Member Author

TODO:

  • Remove testing code which differentiated between compiled and non-compiled runs.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant