Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions upath/tests/implementations/test_github.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
20 changes: 0 additions & 20 deletions upath/tests/implementations/test_hf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import functools

import pytest
from fsspec import get_filesystem_class

Expand All @@ -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)
Expand Down