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

Remove skip_biggus from unit/fileformats/test_rules.py #2459

Merged
merged 1 commit into from
May 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions lib/iris/tests/unit/fileformats/test_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,10 @@
Reference, ReferenceTarget, load_cubes,
scalar_cell_method)
from iris.coords import CellMethod
from iris.tests import mock
import iris.tests.stock as stock


class Mock(object):
def __repr__(self):
return '<Mock {!r}>'.format(self.__dict__)


class TestConcreteReferenceTarget(tests.IrisTest):
def test_attributes(self):
with self.assertRaises(TypeError):
Expand Down Expand Up @@ -105,22 +101,25 @@ def transform(cube):


class TestLoadCubes(tests.IrisTest):
@tests.skip_biggus
def test_simple_factory(self):
# Test the creation process for a factory definition which only
# uses simple dict arguments.

# The fake PPField which will be supplied to our converter.
field = Mock()
field.data = None
field = mock.Mock()
field.core_data = mock.Mock()
# Add a compute attribute so that the data will be treated as lazy.
field.core_data.compute = None
Copy link
Member

@DPeterK DPeterK May 15, 2017

Choose a reason for hiding this comment

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

OK, I don't understand why the mock object needs to pretend to be lazy (the test runs just fine without this line). I also don't see this line as a deal-breaker, though...

field.core_data.dtype = None
field.bmdi = None

def field_generator(filename):
return [field]

# A fake conversion function returning:
# 1) A parameter cube needing a simple factory construction.
aux_factory = Mock()
factory = Mock()
aux_factory = mock.Mock()
factory = mock.Mock()
factory.args = [{'name': 'foo'}]
factory.factory_class = lambda *args: \
setattr(aux_factory, 'fake_args', args) or aux_factory
Expand Down Expand Up @@ -156,7 +155,6 @@ def converter(field):
self.assertEqual(aux_factory.fake_args, ({'name': 'foo'},))

@tests.skip_data
@tests.skip_biggus
def test_cross_reference(self):
# Test the creation process for a factory definition which uses
# a cross-reference.
Expand All @@ -177,10 +175,12 @@ def test_cross_reference(self):
assert not param_cube.coords('surface_altitude')

# The fake PPFields which will be supplied to our converter.
press_field = Mock()
press_field.data = param_cube.data
orog_field = Mock()
orog_field.data = orog_cube.data
press_field = mock.Mock()
press_field.core_data = param_cube.data
press_field.bmdi = -1e20
orog_field = mock.Mock()
orog_field.core_data = orog_cube.data
orog_field.bmdi = -1e20

def field_generator(filename):
return [press_field, orog_field]
Expand Down