From b15c019ffca2cb2127694c709c234aa7a8566aee Mon Sep 17 00:00:00 2001 From: Enric Pou Date: Mon, 26 May 2025 09:21:12 +0200 Subject: [PATCH] Fix tests --- Tests/test_tiff_ifdrational.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Tests/test_tiff_ifdrational.py b/Tests/test_tiff_ifdrational.py index 5233cb2b9..15ef17f84 100644 --- a/Tests/test_tiff_ifdrational.py +++ b/Tests/test_tiff_ifdrational.py @@ -1,6 +1,7 @@ from __future__ import annotations from fractions import Fraction +import math from pathlib import Path import pytest @@ -84,4 +85,8 @@ def test_ifd_rational_save( ], ) def test_float_cast(numerator, denominator, expected_result): - float(IFDRational(numerator, denominator)) == expected_result + value = float(IFDRational(numerator, denominator)) + if math.isnan(expected_result): + assert value + else: + assert value == expected_result