From f84cc4b2b751c899a693237dc669cafde768edd9 Mon Sep 17 00:00:00 2001 From: Andreas Poehlmann Date: Sat, 20 Dec 2025 14:45:52 +0100 Subject: [PATCH] tests: remove two unused helper functions introduced in #492 --- upath/tests/implementations/test_github.py | 11 ----------- upath/tests/implementations/test_hf.py | 20 -------------------- 2 files changed, 31 deletions(-) diff --git a/upath/tests/implementations/test_github.py b/upath/tests/implementations/test_github.py index 66326c92..a5318917 100644 --- a/upath/tests/implementations/test_github.py +++ b/upath/tests/implementations/test_github.py @@ -18,17 +18,6 @@ ) -def has_internet_connection(): - import requests - - try: - requests.get("http://example.com") - except requests.exceptions.ConnectionError: - return False - else: - return True - - def xfail_on_github_rate_limit(func): """ Method decorator to mark test as xfail when GitHub rate limit is exceeded. diff --git a/upath/tests/implementations/test_hf.py b/upath/tests/implementations/test_hf.py index 30f5cccb..d5727d89 100644 --- a/upath/tests/implementations/test_hf.py +++ b/upath/tests/implementations/test_hf.py @@ -1,5 +1,3 @@ -import functools - import pytest from fsspec import get_filesystem_class @@ -14,24 +12,6 @@ pytestmark = pytest.mark.skip -def xfail_on_hf_service_unavailable(func): - """ - Method decorator to mark test as xfail when HuggingFace service is unavailable. - """ - from httpx import HTTPStatusError - - @functools.wraps(func) - def wrapped_method(self, *args, **kwargs): - try: - return func(self, *args, **kwargs) - except HTTPStatusError as err: - if err.response.status_code == 503: - pytest.xfail("HuggingFace API not reachable") - raise - - return wrapped_method - - def test_hfpath(): path = UPath("hf://HuggingFaceTB/SmolLM2-135M") assert isinstance(path, HfPath)