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.

Name the encoding in four test-tree file reads, and re-format them with the pinned ruff (#10522)

Daniel Han9222da45fed5
diff --git a/tests/studio/rag_upload_browser_tests.py b/tests/studio/rag_upload_browser_tests.py
index 8c659523a83..ecdb466503c 100644
--- a/tests/studio/rag_upload_browser_tests.py
+++ b/tests/studio/rag_upload_browser_tests.py
@@ -173,9 +173,9 @@ def overlapping_uploads(page):
wait_state(lambda s: s["waiting"] == 2)
request("/__release-one", {})
page.evaluate("window.first")
- assert page.evaluate("window.sim.uploading"), (
- "The first upload released the second upload's guard"
- )
+ assert page.evaluate(
+ "window.sim.uploading"
+ ), "The first upload released the second upload's guard"
request("/__release", {})
page.evaluate("window.second")
complete(page)
@@ -189,9 +189,9 @@ def concurrent_same_content(page):
request("/__release", {})
page.evaluate("Promise.all([window.first,window.second])")
complete(page)
- assert page.evaluate("window.sim.documents.length") == 1, (
- "Concurrent deduplication left duplicate chips"
- )
+ assert (
+ page.evaluate("window.sim.documents.length") == 1
+ ), "Concurrent deduplication left duplicate chips"
def materialize(page):
@@ -274,7 +274,7 @@ def main():
records.append(record)
browser.close()
(ROOT / ("browser-results-" + "-".join(engines) + ".json")).write_text(
- json.dumps(records, indent = 2)
+ json.dumps(records, indent = 2), encoding = "utf-8"
)
raise SystemExit(any(r["status"] == "failed" for r in records))
diff --git a/tests/studio/rag_upload_ci.py b/tests/studio/rag_upload_ci.py
index 2892f981dcf..4c7f73073ac 100644
--- a/tests/studio/rag_upload_ci.py
+++ b/tests/studio/rag_upload_ci.py
@@ -223,6 +223,7 @@ if run("frontend-install", [npm, "ci"], cwd = frontend):
(root / "summary.json").write_text(
json.dumps(
{"os": platform.platform(), "python": sys.version, "failed_steps": failures}, indent = 2
- )
+ ),
+ encoding = "utf-8",
)
raise SystemExit(bool(failures))
diff --git a/tests/test_wheel_smoke_publish_guard.py b/tests/test_wheel_smoke_publish_guard.py
index 81ba4192ea7..5b81f541c6c 100644
--- a/tests/test_wheel_smoke_publish_guard.py
+++ b/tests/test_wheel_smoke_publish_guard.py
@@ -21,7 +21,7 @@ STEP_NAME = "Publishing path uploads the wheel only"
def _workflow():
- return yaml.safe_load(WORKFLOW.read_text())
+ return yaml.safe_load(WORKFLOW.read_text(encoding = "utf-8"))
def _on_block(wf):
@@ -183,7 +183,7 @@ def test_commented_out_upload_is_not_an_artifact(tmp_path):
def test_real_build_sh_passes_the_guard(tmp_path):
- r = _run_guard(tmp_path, (REPO / "build.sh").read_text())
+ r = _run_guard(tmp_path, (REPO / "build.sh").read_text(encoding = "utf-8"))
assert r.returncode == 0, r.stdout + r.stderr