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.

Fix two pre-existing Backend CI failures blocking every open PR (#7639)

Daniel Han1564ce458515
diff --git a/tests/studio/test_model_picker_contracts.py b/tests/studio/test_model_picker_contracts.py
index 8136c47cd99..f13e3e0e1e1 100644
--- a/tests/studio/test_model_picker_contracts.py
+++ b/tests/studio/test_model_picker_contracts.py
@@ -29,7 +29,7 @@ def _read(rel: str) -> str:
def _read_backend(rel: str) -> str:
path = WORKDIR / "studio" / "backend" / rel
assert path.exists(), f"missing backend source file: {path}"
- return path.read_text()
+ return path.read_text(encoding = "utf-8")
def test_models_api_sends_token_via_header_not_query():
diff --git a/unsloth_cli/tests/conftest.py b/unsloth_cli/tests/conftest.py
index bb42914e693..2f823be432d 100644
--- a/unsloth_cli/tests/conftest.py
+++ b/unsloth_cli/tests/conftest.py
@@ -9,6 +9,23 @@ import types
import pytest
[email protected](autouse = True)
+def _plain_cli_output(monkeypatch):
+ """Keep Typer/Rich from colouring the output these tests assert on.
+
+ Typer renders usage and parameter errors through Rich, which emits ANSI
+ escapes as soon as FORCE_COLOR is set -- and a runner that exports it (as
+ ours does) splits a plain substring like "Invalid value for
+ '--gpu-memory-mode'" across escape sequences, so `in result.output` stops
+ matching even though the message is right there. Setting NO_COLOR is not
+ enough on its own: FORCE_COLOR still wins, so it has to be removed.
+ """
+ for var in ("FORCE_COLOR", "CLICOLOR_FORCE"):
+ monkeypatch.delenv(var, raising = False)
+ monkeypatch.setenv("NO_COLOR", "1")
+ monkeypatch.setenv("TERM", "dumb")
+
+
@pytest.fixture
def stub_tool_policy_state(monkeypatch):
"""Stub the backend's `state.tool_policy`, which run() imports in-venv.