From 5247421088fda7606b0640f2093ce61b2b263f45 Mon Sep 17 00:00:00 2001 From: Isotr0py <2037008807@qq.com> Date: Mon, 7 Oct 2024 18:05:32 +0800 Subject: [PATCH] update test --- test/test_plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_plugin.py b/test/test_plugin.py index e3d1428..bf09685 100644 --- a/test/test_plugin.py +++ b/test/test_plugin.py @@ -15,7 +15,7 @@ def test_decode(): assert img_jxl.mode == img_png.mode == "RGBA" assert not img_jxl.is_animated assert img_jxl.n_frames == 1 - assert list(img_jxl.getdata()) == list(img_png.getdata()) + assert np.allclose(np.array(img_jxl), np.array(img_png)) def test_decode_I16(): @@ -26,7 +26,7 @@ def test_decode_I16(): assert img_jxl.mode == img_png.mode == "I;16" assert not img_jxl.is_animated assert img_jxl.n_frames == 1 - # assert list(img_jxl.getdata()) == list(img_png.getdata()) + # we need to use atol=1 here otherwise the test will fail on MacOS assert np.allclose(np.array(img_jxl), np.array(img_png), rtol=1e-3, atol=1)