Skip to content

Commit

Permalink
Merge pull request #2 from rhattersley/fix-warnings
Browse files Browse the repository at this point in the history
Isolate netcdf_promote adjustment
  • Loading branch information
lbdreyer committed Sep 22, 2015
2 parents 4b207f9 + 346723f commit 8dc8f90
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/iris/tests/unit/unit/test_suppress_unit_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@
from iris.unit import suppress_unit_warnings


iris.FUTURE.netcdf_promote = True


class Test(tests.IrisTest):

def test_generic_warnings(self):
unit_warning = ("Ignoring netCDF variable 'AL' invalid "
"units '(0 - 1)'")
Expand All @@ -52,7 +48,8 @@ def test_load_file_with_captured_warnings(self):
test_filename = tests.get_data_path(('NetCDF', 'testing', 'units.nc'))
with warnings.catch_warnings(record=True) as filtered_warnings:
with suppress_unit_warnings():
iris.load(test_filename)
with iris.FUTURE.context(netcdf_promote=True):
iris.load(test_filename)
filtered_warnings_list = [str(w.message) for w in filtered_warnings]
self.assertEqual(len(filtered_warnings_list), 0)

Expand Down

0 comments on commit 8dc8f90

Please sign in to comment.