From 09833794077e4590f1a98a609e0adb4eaa5c30c9 Mon Sep 17 00:00:00 2001 From: "Aeliton G. Silva" Date: Tue, 26 May 2026 20:34:26 -0300 Subject: [PATCH] Relax test comparison The test that breaks in i686 and arm64 is summing image data, which can have small differences between platforms. The current relaxation will accept comparisons that differ in 0.001%, so that when the test is run on different platforms it has the chance to pass. Signed-off-by: Aeliton G. Silva --- tests/test_comp_spectrum.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_comp_spectrum.py b/tests/test_comp_spectrum.py index 5dd4e2d..3fddd44 100644 --- a/tests/test_comp_spectrum.py +++ b/tests/test_comp_spectrum.py @@ -1,6 +1,6 @@ from avp.command import Command from pytestqt import qtbot -from pytest import fixture +from pytest import fixture, approx from . import ( imageDataSum, command, @@ -21,7 +21,10 @@ def coreWithSpectrumComp(qtbot, command): def test_comp_spectrum_previewRender(coreWithSpectrumComp): comp = coreWithSpectrumComp.selectedComponents[0] image = comp.previewRender() - assert imageDataSum(image) == 71992628 + + accept_range = 719 # Accept images with ±0.001% difference + expected = 71992628 # This value was extracted on amd64 + assert imageDataSum(image) == approx(expected, abs=accept_range) def test_comp_spectrum_renderFrame(coreWithSpectrumComp, audioData):