diff --git a/testsuite/MDAnalysisTests/analysis/test_persistencelength.py b/testsuite/MDAnalysisTests/analysis/test_persistencelength.py index 54005c8a66..4e155bc2ea 100644 --- a/testsuite/MDAnalysisTests/analysis/test_persistencelength.py +++ b/testsuite/MDAnalysisTests/analysis/test_persistencelength.py @@ -31,7 +31,7 @@ import matplotlib import matplotlib.pyplot as plt -from numpy.testing import assert_almost_equal, assert_equal +from numpy.testing import assert_equal from MDAnalysisTests.datafiles import Plength, TRZ_psf, TRZ @@ -73,10 +73,10 @@ def test_run(self, p_run): assert len(p_run.results.bond_autocorrelation) == 280 def test_lb(self, p_run): - assert_almost_equal(p_run.results.lb, 1.485, 3) + assert p_run.results.lb == pytest.approx(1.485, abs=1e-3) def test_fit(self, p_run): - assert_almost_equal(p_run.results.lp, 6.504, 3) + assert p_run.results.lp == pytest.approx(6.504, abs=1e-3) assert len(p_run.results.fit) == len( p_run.results.bond_autocorrelation ) @@ -124,7 +124,7 @@ def test_fit_noisy(self): a = polymer.fit_exponential_decay(self.x, y2) - assert_almost_equal(a, self.a_ref, decimal=3) + assert a == pytest.approx(self.a_ref, abs=1e-3) # assert np.rint(a) == self.a_ref