-
Notifications
You must be signed in to change notification settings - Fork 44
external grib test data skipper and hook #212
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
Conversation
pp-mo
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.
Suggested to explain the skip warning a bit.
Otherwise all good I reckon : I have now tested behaviour with no iris testdata, and no grib testdata.
all 👍
iris_grib/tests/__init__.py
Outdated
| no_data = not os.path.isdir(dpath) or os.environ.get(evar) | ||
|
|
||
| skip = unittest.skipIf( | ||
| condition=no_data, reason="Test(s) require external 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.
"Test(s) require external data." is a bit brief, and indistinguishable from the Iris missing-testdata message.
? Could we go with ...
reason = ("Test(s) require test grib files."
"\nSee : https://github.com/SciTools/iris-grib/tree/v0.15.1/iris_grib/tests/testdata")
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.
@pp-mo No worries. Good idea. I've changed it to something different, but similar:
Test(s) require missing external GRIB test data.
I think it's a bit noisy to have a URI in there... anyways, see what you think 👍
Yeah, I thought you might say that ! |
|
@lbdreyer This change should come in handy for testing a packaged version of |
Very much so! Makes testing much easier! |
This PR adds some simple testing infra-structure changes to support external test data.
The
iris-gribpackage is not shipped with the test data within this repo, and as such, developers cannot easily test a packaged version ofiris-grib. Note that, the tests themselves are indeed shipped with theiris-gribpackage.This PR adds an
iris_grib.tests.skip_datadecorator and also allows developers to specify the external directory that contains theiris-gribdata using theGRIB_TEST_DATA_PATHenvironment variable.In addition to this, developers may also set the
GRIB_TEST_NO_DATAenvironment variable to explicitly skip tests (via theskip_datadecorator) that require said external test data.