-
Notifications
You must be signed in to change notification settings - Fork 300
Remove references to SAMPLE_DATA_DIR #2787
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
Remove references to SAMPLE_DATA_DIR #2787
Conversation
corinnebosley
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Pending tests passing, I would be happy to merge.
DPeterK
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djkirkham just a small thing from me, otherwise looking good! 👍
lib/iris/__init__.py
Outdated
| "'iris_sample_data' package.") | ||
| warn_deprecated(wmsg) | ||
| target = os.path.join(iris.config.SAMPLE_DATA_DIR, target) | ||
| raise ValueError("Please install the 'iris_sample_data' package to " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's finicky I know, but could this be an ImportError? Seems to make more sense.
You could even then make this a try-except block then.
| class TestIrisSampleDataMissing(tests.IrisTest): | ||
| def test_no_iris_sample_data(self): | ||
| self.patch('iris.iris_sample_data', None) | ||
| with self.assertRaisesRegexp(ValueError, 'Please install'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you choose to change the error class above you'll need to change it here too.
lib/iris/__init__.py
Outdated
| warn_deprecated(wmsg) | ||
| target = os.path.join(iris.config.SAMPLE_DATA_DIR, target) | ||
| raise ImportError("Please install the 'iris_sample_data' package to " | ||
| "access sample data.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dah! This line is unindented by just one character but it's causing a whole load of test failures 😢
66d2b8d to
dda2af5
Compare
Closes #2654