Skip to content

Commit

Permalink
Use assertArrayAllClose for sqrt test (SciTools#4118)
Browse files Browse the repository at this point in the history
* using AllClose for sqrt test

* Omitting the checksum from test cml

* use ArrayAllClose (rebase reset it?)
  • Loading branch information
jamesp authored and rcomer committed May 12, 2021
1 parent 887e737 commit 5ec7837
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/iris/tests/results/analysis/sqrt.cml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
</coord>
</coords>
<cellMethods/>
<data checksum="0x09ef96ca" dtype="float64" shape="(73, 96)"/>
<data dtype="float64" shape="(73, 96)" state="loaded"/>
</cube>
</cubes>
4 changes: 2 additions & 2 deletions lib/iris/tests/test_basic_maths.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,8 @@ def test_square_root(self):

e = a ** 0.5

self.assertArrayEqual(e.data, a.data ** 0.5)
self.assertCML(e, ("analysis", "sqrt.cml"))
self.assertArrayAllClose(e.data, a.data ** 0.5)
self.assertCML(e, ("analysis", "sqrt.cml"), checksum=False)
self.assertRaises(ValueError, iris.analysis.maths.exponentiate, a, 0.3)

def test_type_error(self):
Expand Down

0 comments on commit 5ec7837

Please sign in to comment.