Skip to content

Commit

Permalink
Make test_analysis PyTest (#5859)
Browse files Browse the repository at this point in the history
* Fixes to _shared_utils.

* Make test_analysis.py pytest.

* Make test_analysis_calculus.py pytest.

* Remove np.testing.
  • Loading branch information
trexfeathers authored Mar 19, 2024
1 parent b19650d commit 04002bb
Show file tree
Hide file tree
Showing 3 changed files with 518 additions and 385 deletions.
6 changes: 3 additions & 3 deletions lib/iris/tests/_shared_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def assert_CML_approx_data(
fname[-1] = fname[-1][:-4]
fname[-1] += ".data.%d.json" % i
assert_data_almost_equal(cube.data, fname, **kwargs)
assert_CML(cubes, reference_filename, checksum=False)
assert_CML(request, cubes, reference_filename, checksum=False)


def assert_CDL(
Expand Down Expand Up @@ -459,8 +459,8 @@ def assert_data_almost_equal(data, reference_filename, **kwargs):
kwargs.setdefault("err_msg", "Reference file %s" % reference_path)
with open(reference_path, "r") as reference_file:
stats = json.load(reference_file)
assert stats.get("shape", []), list(data.shape)
assert stats.get("masked", False), ma.is_masked(data)
assert stats.get("shape", []) == list(data.shape)
assert stats.get("masked", False) == ma.is_masked(data)
nstats = np.array(
(
stats.get("mean", 0.0),
Expand Down
Loading

0 comments on commit 04002bb

Please sign in to comment.