From 70d6f431e3e5bddbe5639375acb62155b8dceb4a Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Tue, 6 Oct 2026 10:23:20 +0200 Subject: [PATCH] fix: count variant choices made through validated_choice --- tests/test_variant_choice.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_variant_choice.py b/tests/test_variant_choice.py index 57eb8e4d..97ddd53a 100644 --- a/tests/test_variant_choice.py +++ b/tests/test_variant_choice.py @@ -81,8 +81,10 @@ class OneImplementation(unittest.TestCase): for name in ("verify.py", "generate_pack.py"): source = (REPO_ROOT / "scripts" / name).read_text(encoding="utf-8") with self.subTest(module=name): - self.assertGreaterEqual(len(re.findall(r"find_validated_variant\(", source)), 2 - if name == "generate_pack.py" else 3) + # Directly or through validated_choice, the one place that + # picks the variant a destination ships. + calls = re.findall(r"(?:find_validated_variant|validated_choice)\(", source) + self.assertGreaterEqual(len(calls), 2 if name == "generate_pack.py" else 3) if __name__ == "__main__":