Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions lib/iris/tests/integration/analysis/__init__.py
Original file line number Diff line number Diff line change
@@ -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."""
18 changes: 8 additions & 10 deletions lib/iris/tests/integration/analysis/test_area_weighted.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
# importing anything else.
import iris.tests as tests # isort:skip

import tempfile

import iris
from iris.analysis import AreaWeighted

Expand All @@ -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
Expand All @@ -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()
Expand All @@ -60,17 +58,17 @@ 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()
real_cube.data
# 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__":
Expand Down