From af506fd76ada27be322d8b89c090dd97a467f7ad Mon Sep 17 00:00:00 2001 From: Harry Mellor <19981378+hmellor@users.noreply.github.com> Date: Tue, 16 Dec 2025 16:02:24 +0000 Subject: [PATCH] Fix instantiation of `HfHubHTTPError` in LoRA test (#30768) Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> --- tests/lora/test_utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/lora/test_utils.py b/tests/lora/test_utils.py index eb026c2ec0209..bec12eeeb48d5 100644 --- a/tests/lora/test_utils.py +++ b/tests/lora/test_utils.py @@ -3,7 +3,7 @@ from collections import OrderedDict from typing import NamedTuple -from unittest.mock import patch +from unittest.mock import MagicMock, patch import pytest from huggingface_hub.utils import HfHubHTTPError @@ -194,5 +194,8 @@ def test_get_adapter_absolute_path_huggingface_error( # Hugging Face model identifier with download error path = "org/repo" mock_exist.return_value = False - mock_snapshot_download.side_effect = HfHubHTTPError("failed to query model info") + mock_snapshot_download.side_effect = HfHubHTTPError( + "failed to query model info", + response=MagicMock(), + ) assert get_adapter_absolute_path(path) == path