-
Notifications
You must be signed in to change notification settings - Fork 668
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
Tag unit testing failures for optional dependencies as known failures #124
Comments
So now we've got travis we should be able to include this as part of the build matrix, so we build with
I think our only optional dependencies are NCDF and matplotlib. I thought scipy was too, but it's in the required in |
The full functional core (i.e. not analysis or visualization) needs
Analysis wants for full functionality
Visualization wants
Not all of these are easy to install with
and make others like |
https://github.com/MDAnalysis/mdanalysis/blob/develop/package/setup.py#L267 Does this mean scipy is required? I think you're right in that it's not used anywhere but analysis... if memory serves. |
Hm, I am confused (read: to lazy to look up at the moment) what |
I'm going to bump this because installing netcdf isn't trivial and running all the tests without it gives a lot of Error results |
So you want a decorator that decides that if netcdf is not installed then it should be a knownfailure? I think |
Yeah I was thinking along those lines, I didn't know it already existed. I'll look into those |
Btw, the conda install magically installs netcdf (it seems), at least that was my experience when I tested conda-based installation on a pristine VM. |
with conda, it's trivial. :D |
Something along executable_not_found_runtime(); in fact it should be used with |
It was possible with our existing import MDAnalysis as mda
def check_ncdf():
try:
import netCDF
except ImportError:
return True
else
return False
@knownfailure_if(check_ncdf)
def test _ncdfthing I think I can get that bundled with 0.12.1. Then going forward we want our travis build to have another dimension, which is testing both minimal and full installations. |
That's a cool idea @richardjgowers. We can even overload the already existing knownfailure to take an argument In this particular case it'd become: @knownfailure(only_if=check_ncdf) #The check could use a better name...
def test _ncdfthing What do you think? I'll be glad to make a PR for it. |
Yeah a kwarg for knownfailure might be smarter actually. If you want to take this that would be great. |
In the end I think @orbeckst's skipif way is cleaner. Had to decorate each and every test under the netCDF test classes. These numpy decorators can't be applied to classes. |
I had luck just decorating the setUp method? |
Ah, should have tried that! ;) |
netCDF tests now skipped if library missing (closes #124)
Some tests requires scipy. Scipy is an optional dependency, so it can be missing leading to the tests to fail. This commit decorate the tests that need scipy with the dec.skipif decorator. This follows the guideline discussed in MDAnalysis#124.
Some tests requires scipy. Scipy is an optional dependency, so it can be missing leading to the tests to fail. This commit decorate the tests that need scipy with the dec.skipif decorator. This follows the guideline discussed in MDAnalysis#124.
Some tests requires scipy. Scipy is an optional dependency, so it can be missing leading to the tests to fail. This commit decorate the tests that need scipy with the dec.skipif decorator. This follows the guideline discussed in MDAnalysis#124.
When running a test that concerns an optional dependency which is not installed on the testing machine, it is assumed that the test will fail due to the dependency not being installed (and not due to a possible bug). The idea is to tag this kind of failure as "known" failure while allowing the test to "properly" fail when the failure is not related to the lack of dependency.
By doing so, an user that is not using the optional dependency will be able to run tests without the output being "polluted" by false positives.
Yet, a warning should be raised in the case a known failure to remind developers that they should take care of it.
Original issue reported on code.google.com by
[email protected]
on 20 Dec 2012 at 8:46The text was updated successfully, but these errors were encountered: