-
Notifications
You must be signed in to change notification settings - Fork 23
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 testing env without optional dependencies #170
Conversation
Seems like the envs are working - but of course the first test in the minimal env has already failed because there is no |
Actually, only two tests seem to be affected: |
Do we have to decorate each function separately or can we decorate the whole class? |
No idea - I guess decorators only work with functions? |
You can also decorate classes (at least in Python 3, don't know about 2.7). |
This would be nice, because in principle we could skip the whole Python file in some cases... Can you check if the decorators from my last commit could work? How would you apply them to classes? |
Before this whole decorator thing gets out of control - since we wrap all our tests in classes derived from |
There is |
Which means we have to repeat these boilerplate checks.
Maybe. We'd still have to pass a condition. |
The solution in my last commit works. However, the following tests fail because they rely on all backends:
And probably even more. This shows that our optional dependencies are heavily worked into the tests. It will probably be quite painful to tease these tests apart. The alternative is to make sklearn and matplotlib required deps. |
I would rather solve this problem by changing the backends so that they do not register themselves with the manager if their requirements are not met. e.g. try:
import sklearn
backend.register('sklearn', generate)
except ImportError:
pass |
Very good - even cleaner with an |
Nice! I did't know you coud use |
I wonder
|
|
Re 2, I've fixed the broken
I think the best thing to do would be to just use whatever package versions the current Anaconda distribution ships (and completely ignore non-MKL because the Anaconda default is MKL). To test the oldest supported packages, we should create a non-Anaconda-based Python env (e.g. installed via Ubuntu packages). I.e., I suggest the following testing envs:
|
|
@mbillingr do you know why the tests now fail after I've moved the imports into |
Because they are imported locally. |
Hm. I thought they were known to the object. What do you think is the best solution here? Make In general, I have the feeling that mixing core tests with optional tests is rather ugly. Can't we do something nicer, such as completely separate core tests from optional tests? |
Global would work, but that is kinda ugly.
Sure. We even have the option to separate them at different levels:
|
Hm. With option 2, we wouldn't have to change the file structure, and we could try/except import errors to see if the tests in the optional class should be run. Shall we go for it? |
👍 |
Closing, if we ever need this, it is probably easier to start from scratch. |
Fixes #166