Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Keep two Backend CI tests valid on uv 0.13 and on runners with no accelerator (#14535)

Daniel Hana0425b4dc663
diff --git a/tests/python/test_install_python_stack.py b/tests/python/test_install_python_stack.py
index ede35af3828..b61f4c70972 100644
--- a/tests/python/test_install_python_stack.py
+++ b/tests/python/test_install_python_stack.py
@@ -410,7 +410,7 @@ class TestUvSafePathWindowsNo8dot3:
assert uvps.uv_safe_path(str(src)) == str(src)
def test_uv_accepts_the_returned_constraint_path(self, tmp_path, monkeypatch):
- """End to end against the real uv: the spaced path is refused, the returned one is read."""
+ """End to end against the real uv. uv < 0.13 cuts a spaced -c path at the space; 0.13 reads it."""
import shutil
import subprocess
import sys
@@ -435,16 +435,22 @@ class TestUvSafePathWindowsNo8dot3:
sys.executable,
"-c",
constraint,
- "pip",
+ "pytest", # installed wherever this runs, so the offline plan resolves
],
capture_output = True,
text = True,
)
- refused = dry_run(str(src))
- assert "File not found" in refused.stderr, refused.stderr
- accepted = dry_run(uvps.uv_safe_path(str(src)))
- assert "File not found" not in accepted.stderr, accepted.stderr
+ safe = uvps.uv_safe_path(str(src))
+ spaced = dry_run(str(src))
+ if spaced.returncode != 0:
+ assert "File not found" in spaced.stderr, spaced.stderr
+ assert str(src).split(" ")[0] in spaced.stderr, spaced.stderr
+ if " " in uvps.tempfile.gettempdir():
+ pytest.skip("temp dir has a space and no short name: nothing uv < 0.13 can read")
+ assert " " not in safe
+ accepted = dry_run(safe)
+ assert accepted.returncode == 0, accepted.stderr
@pytest.mark.skipif(not ips.IS_WINDOWS, reason = "real NTFS 8.3 names")
def test_real_directory_without_a_short_name(self, tmp_path):
diff --git a/tests/test_custom_dtype_linear_input_cast.py b/tests/test_custom_dtype_linear_input_cast.py
index 431a0f7ea24..367d1e2f92d 100644
--- a/tests/test_custom_dtype_linear_input_cast.py
+++ b/tests/test_custom_dtype_linear_input_cast.py
@@ -84,7 +84,7 @@ def test_no_hook_when_nothing_moved_off_the_load_dtype():
def test_vision_loader_hooks_after_the_custom_dtype_code():
- tree = ast.parse(VISION.read_text())
+ tree = ast.parse(VISION.read_text(encoding = "utf-8"))
for node in ast.walk(tree):
if not isinstance(node, ast.If):
continue
diff --git a/tests/test_gc_enable_kwargs.py b/tests/test_gc_enable_kwargs.py
index 52396184b41..fc259741b2e 100644
--- a/tests/test_gc_enable_kwargs.py
+++ b/tests/test_gc_enable_kwargs.py
@@ -184,6 +184,15 @@ def test_native_offload_kept_with_stock_checkpoint(patched, monkeypatch):
real = hf_modeling_utils.save_on_cpu
class Counting(real):
+ def __init__(
+ self,
+ pin_memory = False,
+ device_type = "cuda",
+ ):
+ # transformers always asks for pinned memory, which torch refuses with no usable accelerator.
+ pin_memory = pin_memory and torch.accelerator.is_available()
+ super().__init__(pin_memory = pin_memory, device_type = device_type)
+
def __enter__(self):
entered.append(1)
return super().__enter__()