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.

Anchor the worker source read on the test file, not the working directory (#11495)

Daniel Han42fc28f8d654
diff --git a/studio/backend/tests/test_vision_client_tools.py b/studio/backend/tests/test_vision_client_tools.py
index 20d905c8543..00271dd8ec2 100644
--- a/studio/backend/tests/test_vision_client_tools.py
+++ b/studio/backend/tests/test_vision_client_tools.py
@@ -491,7 +491,12 @@ def test_the_worker_forwards_the_processor_template_to_the_parent():
import ast
import pathlib
- source = pathlib.Path("core/inference/worker.py").read_text()
+ # Anchored on this file, like the same read in test_native_context_length and
+ # test_audio_unsupported_backend_error. A bare relative path resolves against the
+ # working directory, so this only found the worker when pytest happened to be
+ # invoked from studio/backend and raised FileNotFoundError from anywhere else.
+ worker = pathlib.Path(__file__).resolve().parents[1] / "core/inference/worker.py"
+ source = worker.read_text("utf-8")
tree = ast.parse(source)
keys: set = set()
for node in ast.walk(tree):