diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index 738b7033d1..c13974529a 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -220,6 +220,8 @@ This document explains the changes made to Iris for this release using assertArrayAllClose following :issue:`3993`. (:pull:`4421`) +#. `@rcomer`_ applied minor fixes to some regridding tests. (:pull:`4432`) + .. 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/integration/analysis/__init__.py b/lib/iris/tests/integration/analysis/__init__.py new file mode 100644 index 0000000000..20b6250b70 --- /dev/null +++ b/lib/iris/tests/integration/analysis/__init__.py @@ -0,0 +1,6 @@ +# Copyright Iris contributors +# +# This file is part of Iris and is released under the LGPL license. +# See COPYING and COPYING.LESSER in the root of the repository for full +# licensing details. +"""Integration tests for the :mod:`iris.analysis` package.""" diff --git a/lib/iris/tests/integration/analysis/test_area_weighted.py b/lib/iris/tests/integration/analysis/test_area_weighted.py index d2f1a4ad44..d01da79a56 100644 --- a/lib/iris/tests/integration/analysis/test_area_weighted.py +++ b/lib/iris/tests/integration/analysis/test_area_weighted.py @@ -9,8 +9,6 @@ # importing anything else. import iris.tests as tests # isort:skip -import tempfile - import iris from iris.analysis import AreaWeighted @@ -37,8 +35,8 @@ def test_regrid_area_w_lazy(self): self.assertTrue(self.cube.has_lazy_data()) self.assertTrue(out.has_lazy_data()) # Save the data - with tempfile.TemporaryFile(suffix=".nc") as fp: - iris.save(out, fp) + with self.temp_filename(suffix=".nc") as fname: + iris.save(out, fname) def test_regrid_area_w_lazy_chunked(self): # Chunked data makes the regridder run repeatedly @@ -49,8 +47,8 @@ def test_regrid_area_w_lazy_chunked(self): self.assertTrue(self.cube.has_lazy_data()) self.assertTrue(out.has_lazy_data()) # Save the data - with tempfile.TemporaryFile(suffix=".nc") as fp: - iris.save(out, fp) + with self.temp_filename(suffix=".nc") as fname: + iris.save(out, fname) def test_regrid_area_w_real_save(self): real_cube = self.cube.copy() @@ -60,8 +58,8 @@ def test_regrid_area_w_real_save(self): # Realise the data out.data # Save the data - with tempfile.TemporaryFile(suffix=".nc") as fp: - iris.save(out, fp) + with self.temp_filename(suffix=".nc") as fname: + iris.save(out, fname) def test_regrid_area_w_real_start(self): real_cube = self.cube.copy() @@ -69,8 +67,8 @@ def test_regrid_area_w_real_start(self): # Regrid the cube onto the template. out = real_cube.regrid(self.template_cube, AreaWeighted()) # Save the data - with tempfile.TemporaryFile(suffix=".nc") as fp: - iris.save(out, fp) + with self.temp_filename(suffix=".nc") as fname: + iris.save(out, fname) if __name__ == "__main__":