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(packaging): count a `unittest discover` glob as wiring its suites

Nandakishor41856470ea89
diff --git a/tests/test_packaging.py b/tests/test_packaging.py
index 3275ffe3..f7ab2abd 100644
--- a/tests/test_packaging.py
+++ b/tests/test_packaging.py
@@ -3,6 +3,7 @@
Text parsing, not tomllib: the floor is 3.10 and tomllib arrives in 3.11.
"""
import ast
+import fnmatch
import os
import re
import shlex
@@ -160,6 +161,15 @@ def _invoked_workflow_tests(yaml_text):
invoked.update(re.findall(r"\btests/(test_[a-zA-Z0-9_]+\.py)\b", part))
elif re.search(r"\bpython(?:\d+(?:\.\d+)?)?\s+.*?tests/(test_[a-zA-Z0-9_]+\.py)\b", part):
invoked.update(re.findall(r"\btests/(test_[a-zA-Z0-9_]+\.py)\b", part))
+ else:
+ # `unittest discover` runs a whole glob rather than naming files, so expand it
+ # against the tree. A lane that discovers `test_zh_*.py` has wired every suite
+ # the glob matches, and naming them again in the workflow would only drift.
+ found = re.search(r"\bunittest\s+discover\b.*?-s\s+tests\b"
+ r".*?-p\s+'?\"?([^'\" ]+)", part)
+ if found:
+ invoked.update(fnmatch.filter(os.listdir(os.path.join(ROOT, "tests")),
+ found.group(1)))
return invoked