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

Stock #2212

Merged
merged 5 commits into from
Oct 25, 2016
Merged

Stock #2212

merged 5 commits into from
Oct 25, 2016

Conversation

marqh
Copy link
Member

@marqh marqh commented Oct 25, 2016

  • move stock npy arrays to iris-test-data stock arrays iris-test-data#45
  • update skip_data pattern usage
  • alter minimal testing environment to not use test_data

@@ -183,7 +183,10 @@ def get_data_path(relative_path):
"""
if not isinstance(relative_path, six.string_types):
relative_path = os.path.join(*relative_path)
data_path = os.path.join(iris.config.TEST_DATA_DIR, relative_path)
test_data_dir = iris.config.TEST_DATA_DIR
if test_data_dir is None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the need for this..
From how iris.config.TEST_DATA_DIR is initialised in iris.config, I think this can't be empty ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can occur, here:
https://github.com/SciTools/iris/blob/master/lib/iris/config.py#L138

override = os.environ.get("override_test_data_repository")
if override:
    if override == '1':
        TEST_DATA_DIR = None
    else:
        TEST_DATA_DIR = override

Copy link
Member

@pp-mo pp-mo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought there would be more examples of a GraphicsTest overriding setUp.
However, this seems to be the only one.

class TestBasic(tests.GraphicsTest):
cube = iris.tests.stock.realistic_4d()
def setUp(self):
self.cube = iris.tests.stock.realistic_4d()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to call the class setUp here :
super(TestBasic, self).setUp()

@pp-mo
Copy link
Member

pp-mo commented Oct 25, 2016

As a cross-check, I ran all tests with control exports:

  • export override_test_data_repository=1 : breaks the config.TEST_DATA_DIR value
  • export IRIS_TEST_NO_DATA=1 : force everything wrapped in "skip_data" to skip

The only failure is this one :

iris.tests.experimental.regrid.test_regrid_conservative_via_esmpy.TestConservativeRegrid.test_multidimensional

So, that needs wrapping with "skip_data".

@pp-mo pp-mo merged commit 46a20d7 into SciTools:master Oct 25, 2016
@QuLogic QuLogic added this to the v2.0 milestone Oct 25, 2016
marqh added a commit to marqh/iris that referenced this pull request Oct 26, 2016
* move stock arrays to test data
@marqh marqh mentioned this pull request Oct 26, 2016
pp-mo pushed a commit that referenced this pull request Oct 26, 2016
* move stock arrays to test data
@QuLogic QuLogic modified the milestones: v2.0, v1.12 Nov 18, 2016
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.

3 participants