Skip to content

Commit 46b9235

Browse files
committed
do not protect failing test with version checks
1 parent 7e9af71 commit 46b9235

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

lib/iris/tests/integration/format_interop/test_name_grib.py

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# (C) British Crown Copyright 2013 - 2016, Met Office
1+
# (C) British Crown Copyright 2013 - 2017, Met Office
22
#
33
# This file is part of Iris.
44
#
@@ -72,21 +72,18 @@ def check_common(self, name_cube, grib_cube):
7272
def test_name2_field(self):
7373
filepath = tests.get_data_path(('NAME', 'NAMEII_field.txt'))
7474
name_cubes = iris.load(filepath)
75-
# Check gribapi version, because we currently have a known load/save
76-
# problem with gribapi 1v14 (at least).
77-
gribapi_ver = gribapi.grib_get_api_version()
78-
gribapi_fully_supported_version = \
79-
(StrictVersion(gribapi.grib_get_api_version()) <
80-
StrictVersion('1.13'))
75+
76+
# we currently have a known load/save
77+
# problem with gribapi version and zero only data, where min == max.
78+
8179
for i, name_cube in enumerate(name_cubes):
82-
if not gribapi_fully_supported_version:
83-
data = name_cube.data
84-
if np.min(data) == np.max(data):
85-
msg = ('NAMEII cube #{}, "{}" has empty data : '
86-
'SKIPPING test for this cube, as save/load will '
87-
'not currently work with gribabi > 1v12.')
88-
warnings.warn(msg.format(i, name_cube.name()))
89-
continue
80+
data = name_cube.data
81+
if np.min(data) == np.max(data):
82+
msg = ('NAMEII cube #{}, "{}" has empty data : '
83+
'SKIPPING test for this cube, as save/load will '
84+
'not currently work with gribabi > 1v12.')
85+
warnings.warn(msg.format(i, name_cube.name()))
86+
continue
9087

9188
with self.temp_filename('.grib2') as temp_filename:
9289
iris.save(name_cube, temp_filename)

0 commit comments

Comments
 (0)