Skip to content

armgit / laya

Public Imported from GitHub
0

Non-autoregressive System 1 decision engine. Typed choice, score and yes/no decisions over any text in a single forward pass, in 100+ languages, with a router that picks the right checkpoint per request.

test(mcp): make the force= pass-through check fail by name, not by abort

Aashish84e815665ca0
diff --git a/tests/test_mcp_device.py b/tests/test_mcp_device.py
index 704eca78..8e338b5d 100644
--- a/tests/test_mcp_device.py
+++ b/tests/test_mcp_device.py
@@ -113,8 +113,14 @@ def test_the_env_path_raises_and_force_passes_through():
else:
os.environ["LAYA_DEVICE"] = old
# force= is the documented tests hook: it is returned verbatim, exactly like the
- # CLI --device flag, which never reads the environment.
- ok("force= hook stays verbatim", resolve_device("cuda:") == "cuda:")
+ # CLI --device flag, which never reads the environment. Guarded, because the check is
+ # about the pass-through: a version that parses `force` has to fail by name, not abort.
+ try:
+ forced = resolve_device("cuda:")
+ except Exception as exc:
+ ok("force= hook stays verbatim", False, "raised %s: %s" % (type(exc).__name__, exc))
+ else:
+ ok("force= hook stays verbatim", forced == "cuda:", repr(forced))
def parses(value):