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
1 change: 1 addition & 0 deletions docs/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ This document explains the changes made to Iris for this release
benchmark historic commits (especially older Python versions).
(:pull:`5963`)

#. `@bouweandela`_ made some tests for :func:`~iris.iterate.izip` faster. (:pull:`6041`)

.. comment
Whatsnew author names (@github name) in alphabetical order. Note that,
Expand Down
25 changes: 25 additions & 0 deletions lib/iris/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,31 @@ def assert_masked_array_almost_equal(a, b, decimal=6, strict=False):
)


def assert_cml(cubes, reference_filename=None, checksum=True):
"""Test that the CML for the given cubes matches the contents of
the reference file.

If the environment variable IRIS_TEST_CREATE_MISSING is
non-empty, the reference file is created if it doesn't exist.

Parameters
----------
cubes :
Either a Cube or a sequence of Cubes.
reference_filename : optional, default=None
The relative path (relative to the test results directory).
If omitted, the result is generated from the calling
method's name, class, and module using
:meth:`iris.tests.IrisTest.result_path`.
checksum : bool, optional
When True, causes the CML to include a checksum for each
Cube's data. Defaults to True.

"""
test = IrisTest()
test.assertCML(cubes, reference_filename, checksum)


class IrisTest(unittest.TestCase):
"""A subclass of unittest.TestCase which provides Iris specific testing functionality."""

Expand Down
Loading