diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index 54ce95af7b..ae79764343 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -164,6 +164,9 @@ This document explains the changes made to Iris for this release #. `@bjlittle`_ enabled the `sort-all`_ `pre-commit`_ hook to automatically sort ``__all__`` entries into alphabetical order. (:pull:`4353`) +#. `@rcomer`_ modified a NetCDF saver test to prevent it triggering a numpy + deprecation warning. (:issue:`4374`, :pull:`4376`) + .. comment Whatsnew author names (@github name) in alphabetical order. Note that, core dev names are automatically included by the common_links.inc: diff --git a/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py b/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py index 656673a7a0..cb5cd2954a 100644 --- a/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py +++ b/lib/iris/tests/unit/fileformats/netcdf/test_Saver.py @@ -9,6 +9,7 @@ # importing anything else. import iris.tests as tests # isort:skip +import collections from contextlib import contextmanager from unittest import mock @@ -186,6 +187,8 @@ def test_big_endian(self): def test_zlib(self): cube = self._simple_cube(">f4") api = self.patch("iris.fileformats.netcdf.netCDF4") + # Define mocked default fill values to prevent deprecation warning (#4374). + api.default_fillvals = collections.defaultdict(lambda: -99.0) with Saver("/dummy/path", "NETCDF4") as saver: saver.write(cube, zlib=True) dataset = api.Dataset.return_value