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(hooks): exclude self parameter from positional prefix checks in test_hooks_api (#909)

Swatantra Yadav2420736325d1
diff --git a/tests/test_hooks_api.py b/tests/test_hooks_api.py
index 5c1643cb..b90a2e91 100644
--- a/tests/test_hooks_api.py
+++ b/tests/test_hooks_api.py
@@ -184,10 +184,12 @@ for label, fn in (("Router.route", Router.route),
# Positional compatibility: hook parameters are keyword-only to protect positional callers
check("Router.route_batch/positional prefix",
- [p.name for p in sig(Router.route_batch).values() if p.kind != inspect.Parameter.KEYWORD_ONLY],
+ [p.name for p in sig(Router.route_batch).values()
+ if p.kind != inspect.Parameter.KEYWORD_ONLY and p.name != "self"],
["requests", "hooks_timeout"])
check("Router.predict_batch/positional prefix",
- [p.name for p in sig(Router.predict_batch).values() if p.kind != inspect.Parameter.KEYWORD_ONLY],
+ [p.name for p in sig(Router.predict_batch).values()
+ if p.kind != inspect.Parameter.KEYWORD_ONLY and p.name != "self"],
["requests", "batch_size", "min_confidence", "sort_by_length"])
for param in ("hooks", "hooks_raise"):
check("Router.route_batch/%s is keyword-only" % param,