From bb506781b0cd71c905eb9ea4e15b1ecf53adc848 Mon Sep 17 00:00:00 2001 From: Dilawar Singh <dilawars@ncbs.res.in> Date: Thu, 6 Sep 2018 15:56:39 +0530 Subject: [PATCH] Use np.isclose in tests. --- moose-core/tests/python/test_difshells.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/moose-core/tests/python/test_difshells.py b/moose-core/tests/python/test_difshells.py index 0662a1e9..96c3a6be 100644 --- a/moose-core/tests/python/test_difshells.py +++ b/moose-core/tests/python/test_difshells.py @@ -203,8 +203,8 @@ if __name__ == '__main__': for j, buf in enumerate(buftab[i]): res[:, 4 + i * (difbuff_no + 1) + j + 1] = buf.vector header += ' difshell_' + str(i) + '_difbuff_' + str(j) - assert np.isclose(res.mean(), 0.6059903892218336), \ - 'Expected 0.6059903892218336, got %g' % np.mean(res) - assert np.std(res) == 1.9505369046640817, np.std( res ), \ - 'Expected 1.9505369046640817 got %g' % np.std(res) + assert np.isclose(res.mean(), 0.60599), \ + 'Expected 0.60599, got %g' % np.mean(res) + assert np.std(res) == 1.9505, np.std( res ), \ + 'Expected 1.95053 got %g' % np.std(res) print( 'All done' ) -- GitLab