From e1c1fffdaff3250892d7fce3b03634dd83ed7294 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Tue, 20 Oct 2026 00:12:43 +0200 Subject: [PATCH] fix: follow the shared lookup in the judge guard The core extras loop reaches validated_choice through ExtraResolver.resolve now, so the guard follows that call instead of counting direct calls. --- tests/test_validated_choice.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/test_validated_choice.py b/tests/test_validated_choice.py index 241622ec..74f73068 100644 --- a/tests/test_validated_choice.py +++ b/tests/test_validated_choice.py @@ -113,7 +113,22 @@ class ValidatedChoice(unittest.TestCase): call for call in ast.walk(builder) if isinstance(call, ast.Call) and getattr(call.func, "id", None) == "validated_choice" ] - self.assertGreaterEqual(len(calls), 2) + self.assertGreaterEqual(len(calls), 1) + # The core extras go through the lookup verify shares, which judges. + self.assertTrue(any( + isinstance(call, ast.Call) and getattr(call.func, "attr", None) == "resolve" + and getattr(call.func.value, "id", None) == "extra_resolver" + for call in ast.walk(builder) + )) + extras = ast.parse((REPO_ROOT / "scripts" / "packextras.py").read_text(encoding="utf-8")) + resolve = next( + node for node in ast.walk(extras) + if isinstance(node, ast.FunctionDef) and node.name == "resolve" + ) + self.assertTrue(any( + isinstance(call, ast.Call) and getattr(call.func, "id", None) == "validated_choice" + for call in ast.walk(resolve) + )) class ManifestsServeWhatTheCoreAccepts(unittest.TestCase):