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

Skip tests that use optional dependencies if not installed #176

Merged
merged 4 commits into from
Apr 26, 2017

Conversation

spencerahill
Copy link
Owner

@spencerahill spencerahill commented Apr 26, 2017

Closes #167

Still need to configure CI to use the new minimal dependencies environment.

On this pass I just used pytest.importorskip. I couldn't see any benefit of xarray's more involved route that I originally mimicked. Any thoughts on this? (see below)

@spencerahill
Copy link
Owner Author

Actually for pytest-catchlog, pytest.importorskip isn't a viable solution. Doing it outside the test causes all of the modules tests to be skipped. Doing it inside the test doesn't work because the caplog fixture causes an error before pytest_catchlog can be imported.

So the solution is to mimic xarray's try/except-based decorator approach.

@spencerahill
Copy link
Owner Author

The one failing Travis build is from an error on their side in the 3.4 env; so this should be ok pending Appveyor tests finishing.

@spencerkclark could you review this when you get a chance? Thanks!

@spencerkclark
Copy link
Collaborator

This looks good to me! I went ahead and restarted the Travis build for 3.5, and it looks like things cleared up. Thanks for taking care of this.

@spencerkclark
Copy link
Collaborator

Actually, should this get a what's new entry? I suppose one could consider this a "bug fix," considering that without this setup, the test suite wouldn't pass if one only had the minimum requirements installed.

@spencerahill spencerahill merged commit 4f63d3b into develop Apr 26, 2017
@spencerahill spencerahill deleted the optional-tests branch April 26, 2017 15:35
@spencerahill
Copy link
Owner Author

Thanks @spencerkclark!

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.

None yet

2 participants