Skip to content

Commit

Permalink
fix tests?
Browse files Browse the repository at this point in the history
  • Loading branch information
Wauplin committed Dec 12, 2023
1 parent e4dac78 commit 1712c8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import pytest
import requests

from huggingface_hub.utils import is_gradio_available, logging
from huggingface_hub.utils import is_gradio_available, logging, reset_sessions
from tests.testing_constants import ENDPOINT_PRODUCTION, ENDPOINT_PRODUCTION_URL_SCHEME


Expand Down Expand Up @@ -193,7 +193,9 @@ def offline_socket(*args, **kwargs):
yield
elif mode is OfflineSimulationMode.HF_HUB_OFFLINE_SET_TO_1:
with patch("huggingface_hub.constants.HF_HUB_OFFLINE", True):
reset_sessions()
yield
reset_sessions()
else:
raise ValueError("Please use a value from the OfflineSimulationMode enum.")

Expand Down

0 comments on commit 1712c8d

Please sign in to comment.