diff --git a/tests/test_recog.py b/tests/test_recog.py index 6eed0eb..21966a5 100644 --- a/tests/test_recog.py +++ b/tests/test_recog.py @@ -1,6 +1,7 @@ """Module with library tests""" from pathlib import Path import pytest +import math import pygats.recog as rec import pygats.pygats as pyg from pygats.formatters import MarkdownFormatter as MD @@ -99,4 +100,4 @@ def test_check_text_1(words_for_bg, capsys): def test_contrast(img_path, expected_value): img = Image.open(img_path) contrast = rec.contrast(img) - assert (contrast - expected_value) < 1e-9 + assert math.isclose(contrast, expected_value, rel_tol=1e-09, abs_tol=0.0)