-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add coverage reporting for Numba JIT-compiled functions #32
Comments
Resolved by disabling Numba prior to pytest execution. Turns out while you can set environmental variables in a Python script, the updated values are only accessible from new processes. Although it's possible to spawn a new child process from within a Python script, this can become a little messy with the test and instead Numba is disabled in order to provide accurate coverage reporting. I however believe the successful integration of unit tests with Numba would provide the appropriate set of tests for development, so I will be renaming this issue and reassigning its label. In development, unit tests should be executed successfully both with Numba enabled and disabled (only the coverage reporting is affected). |
Is there a plan to add support for this, such that P.S. If not, at least a good warning should exist, I guess. |
Thanks for asking @snenkov! At this time, I do not have a solution in mind to support coverage reporting of JIT-enabled functions within the code base. I read through the two issues referenced above (from other repositories), and it looks like a solution has yet to be found / developed. If you have any suggestions, please let me know! I agree however that a warning during testing would at least be nice. We can include a warning as part of the next release. |
Thank for the reply @vc1492a . I guess when removing the |
See the unit tests within the repository, line 24 of We're able to run tests with Numba enabled or disabled locally, but for Travis CI we simply run the testing suite with numba disabled (which also reflects how most users will use the PyNomaly software). |
Did anyone try simply monkey patching the |
Hi, any news on that ? Would be really helpful to be able to do it without disabling numba :/ |
Any functions with the
@jit
decorator are not read bypytest-cov
as having been executed despite them running successfully within the unit tests, as they are compiled by numba as C and thus are not Python functions which are able to be evaluated bypytest-cov
.This occurs even when setting the environment variable to disable numba execution, e.g.
NUMBA_DISABLE_JIT = "1"
.The text was updated successfully, but these errors were encountered: