From 947a5ad3ff222628dc34503b9a7a4d45f999d8e0 Mon Sep 17 00:00:00 2001 From: Advitya Gemawat Date: Fri, 23 Feb 2024 12:26:16 -0800 Subject: [PATCH] test fix based on OS --- responsibleai_vision/requirements.txt | 2 +- responsibleai_vision/tests/test_image_utils.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/responsibleai_vision/requirements.txt b/responsibleai_vision/requirements.txt index 13af9e7cd7..01b77df610 100644 --- a/responsibleai_vision/requirements.txt +++ b/responsibleai_vision/requirements.txt @@ -1,6 +1,6 @@ numpy>=1.17.2 pandas>=0.25.1,<2.0.0 # TODO: remove ceiling on version. -Pillow>=10.2.0; python_version>"3.7" # due to breaking changes in v10.0.0 (https://pillow.readthedocs.io/en/latest/releasenotes/10.0.0.html) +Pillow>=10.0.0; python_version>"3.7" # due to breaking changes in v10.0.0 (https://pillow.readthedocs.io/en/latest/releasenotes/10.0.0.html) Pillow<10.0.0; python_version<="3.7" # Pillow v10.0.0 is only available starting with Python 3.8 scikit-learn>=0.22.1 scipy>=1.4.1 diff --git a/responsibleai_vision/tests/test_image_utils.py b/responsibleai_vision/tests/test_image_utils.py index d7c7d1af95..dae1b1af7e 100644 --- a/responsibleai_vision/tests/test_image_utils.py +++ b/responsibleai_vision/tests/test_image_utils.py @@ -6,6 +6,7 @@ from math import isclose from unittest.mock import Mock, patch from urllib.parse import urlparse +import platform import numpy as np from common_vision_utils import load_fridge_object_detection_dataset @@ -95,7 +96,8 @@ def test_retry_sessions_retries_on_conn_failure(self, request_mock): def test_get_all_exif_feature_names(self): image_dataset = load_fridge_object_detection_dataset().head(2) exif_feature_names = get_all_exif_feature_names(image_dataset) - assert len(exif_feature_names) == 49 + num_features = 49 if platform.system() == "Linux" else 60 + assert len(exif_feature_names) == num_features def test_generate_od_error_labels(self): true_y = np.array([[[3, 142, 257, 395, 463, 0]],