Skip to content

Commit

Permalink
revert decorators order
Browse files Browse the repository at this point in the history
  • Loading branch information
hanouticelina committed Feb 13, 2025
1 parent 25ef0db commit bd6d856
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions tests/test_inference_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
TranslationOutput,
VisualQuestionAnsweringOutputElement,
ZeroShotClassificationOutputElement,
constants,
hf_hub_download,
)
from huggingface_hub.errors import HfHubHTTPError, ValidationError
Expand Down Expand Up @@ -209,7 +210,7 @@ def list_clients(task: str) -> List[pytest.param]:
return clients


@pytest.fixture
@pytest.fixture(scope="module")
@with_production_testing
def client(request):
"""
Expand Down Expand Up @@ -266,8 +267,8 @@ def mock_fetch():
monkeypatch.setattr("huggingface_hub.inference._providers.hf_inference._fetch_recommended_models", mock_fetch)


@pytest.mark.vcr
@with_production_testing
@pytest.mark.vcr()
class TestInferenceClient(TestBase):
@pytest.mark.parametrize("client", list_clients("audio-classification"), indirect=True)
def test_audio_classification(self, client: InferenceClient):
Expand Down Expand Up @@ -903,16 +904,12 @@ class TestListDeployedModels(TestBase):
@expect_deprecation("list_deployed_models")
@patch("huggingface_hub.inference._client.get_session")
def test_list_deployed_models_main_frameworks_mock(self, get_session_mock: MagicMock) -> None:
from huggingface_hub import constants

InferenceClient().list_deployed_models()
assert len(get_session_mock.return_value.get.call_args_list) == len(constants.MAIN_INFERENCE_API_FRAMEWORKS)

@expect_deprecation("list_deployed_models")
@patch("huggingface_hub.inference._client.get_session")
def test_list_deployed_models_all_frameworks_mock(self, get_session_mock: MagicMock) -> None:
from huggingface_hub import constants

InferenceClient().list_deployed_models("all")
assert len(get_session_mock.return_value.get.call_args_list) == len(constants.ALL_INFERENCE_API_FRAMEWORKS)

Expand Down

0 comments on commit bd6d856

Please sign in to comment.