From 64a4b47b0769b3ae4c1cc01c2490a2286f45420f 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..870e75b 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 np.asarray(val).dtype.kind == "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.")