diff --git a/lib/iris/tests/unit/fileformats/cf/test_CFReader.py b/lib/iris/tests/unit/fileformats/cf/test_CFReader.py index d3be0b4fec..6de593a0c1 100644 --- a/lib/iris/tests/unit/fileformats/cf/test_CFReader.py +++ b/lib/iris/tests/unit/fileformats/cf/test_CFReader.py @@ -279,9 +279,10 @@ def test_formula_terms_ignore(self): group = cf_group.promoted self.assertEqual(list(group.keys()), ['orography']) self.assertIs(group['orography'].cf_data, self.orography) + self.assertEqual(warn.call_count, 1) else: self.assertEqual(len(cf_group.promoted), 0) - self.assertEqual(warn.call_count, 1) + self.assertEqual(warn.call_count, 2) def test_auxiliary_ignore(self): self.x.dimensions = ['lat', 'wibble'] @@ -296,9 +297,10 @@ def test_auxiliary_ignore(self): self.assertEqual(set(group.keys()), set(promoted)) for name in promoted: self.assertIs(group[name].cf_data, getattr(self, name)) + self.assertEqual(warn.call_count, 1) else: self.assertEqual(len(cf_group.promoted), 0) - self.assertEqual(warn.call_count, 1) + self.assertEqual(warn.call_count, 2) def test_promoted_auxiliary_ignore(self): self.wibble = netcdf_variable('wibble', 'lat wibble', np.float) diff --git a/lib/iris/tests/unit/unit/test_suppress_unit_warnings.py b/lib/iris/tests/unit/unit/test_suppress_unit_warnings.py index 728f030c08..c259029a67 100644 --- a/lib/iris/tests/unit/unit/test_suppress_unit_warnings.py +++ b/lib/iris/tests/unit/unit/test_suppress_unit_warnings.py @@ -29,6 +29,9 @@ from iris.unit import suppress_unit_warnings +iris.FUTURE.netcdf_promote = True + + class Test(tests.IrisTest): def test_generic_warnings(self):