From 48ae2d239207c4c6b7cf571542a28cf36d452686 Mon Sep 17 00:00:00 2001 From: Antonio Valentino Date: Sat, 9 Dec 2023 09:57:39 +0100 Subject: [PATCH] Fix floating point comparison --- pyninjotiff/tests/test_ninjotiff.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyninjotiff/tests/test_ninjotiff.py b/pyninjotiff/tests/test_ninjotiff.py index 2d4f224..20c99fa 100644 --- a/pyninjotiff/tests/test_ninjotiff.py +++ b/pyninjotiff/tests/test_ninjotiff.py @@ -519,7 +519,10 @@ def test_write_rgb_tb(): for key, val in tags.items(): if key in ['datetime', '40002', '40003', '40006']: continue - assert(val == read_tags[key].value) + if hasattr(val, "dtype") and val.dtype.kinf == "f": + np.testing.assert_allclose(val, read_tags[key].value) + else: + assert(val == read_tags[key].value) @pytest.mark.skip(reason="this is no implemented yet.")