From 41ea553533249880251617cef796279c8cfcf933 Mon Sep 17 00:00:00 2001 From: Simon Brugman Date: Tue, 28 Jun 2022 18:24:19 +0200 Subject: [PATCH] refactor: make test robust against floating point --- tests/popmon/base/test_pipeline.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/popmon/base/test_pipeline.py b/tests/popmon/base/test_pipeline.py index 12afc673..b3e06c01 100644 --- a/tests/popmon/base/test_pipeline.py +++ b/tests/popmon/base/test_pipeline.py @@ -98,7 +98,9 @@ def test_popmon_pipeline(test_pipeline): np.power(np.log(datastore["x"]), 2) * datastore["weights"] ) / np.sum(datastore["weights"]) - assert test_pipeline.transform(datastore)["res"] == expected_result + np.testing.assert_array_almost_equal( + test_pipeline.transform(datastore)["res"], expected_result, decimal=12 + ) def test_pipeline_repr(test_pipeline):