From 3b30d439cbaf56a9348d2ae68b50e01d7120f064 Mon Sep 17 00:00:00 2001 From: Palak Gupta Date: Mon, 22 Jun 2026 17:57:09 +0530 Subject: [PATCH 1/2] tests: modernize assertions in test_persistencelength (ref #3743) --- .../MDAnalysisTests/analysis/test_persistencelength.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testsuite/MDAnalysisTests/analysis/test_persistencelength.py b/testsuite/MDAnalysisTests/analysis/test_persistencelength.py index 54005c8a667..4e155bc2ea2 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 From 476dd6e8cf285a7f692fba72d8a0958ffde10f5a Mon Sep 17 00:00:00 2001 From: Palak Gupta Date: Tue, 23 Jun 2026 17:32:22 +0530 Subject: [PATCH 2/2] Trigger CI