fix(ci): skip HF log in (and tests) in forks and community PRs (#3097)

* fix(ci): skip HF log in (and tests) in forks and community PRs

* chore(test): remove comment about test meant to be only run locally

* fix(tests): no hf log in decorator for xvla

* fix(test): no decorator in yield
This commit is contained in:
Steven Palma
2026-03-06 16:33:43 +01:00
committed by GitHub
parent a4c66e530b
commit 85de893fa7
12 changed files with 58 additions and 10 deletions
+16
View File
@@ -108,6 +108,22 @@ def require_cuda(func):
return wrapper
def require_hf_token(func):
"""
Decorator that skips the test if no Hugging Face Hub token is available.
"""
@wraps(func)
def wrapper(*args, **kwargs):
from huggingface_hub import get_token
if get_token() is None:
pytest.skip("requires HF token for gated model access")
return func(*args, **kwargs)
return wrapper
def require_env(func):
"""
Decorator that skips the test if the required environment package is not installed.