Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

test(health): nest the Python lambda fixture through consequence arms (#3448)

Raghav Chamadiya417f9aedff94
diff --git a/tests/unit/health/test_nested_function_complexity.py b/tests/unit/health/test_nested_function_complexity.py
index 1889ce7b5..b4dceb5c2 100644
--- a/tests/unit/health/test_nested_function_complexity.py
+++ b/tests/unit/health/test_nested_function_complexity.py
@@ -325,7 +325,9 @@ _LAMBDAS = [
"python-lambda",
"a.py",
"python",
- "def outer():\n return lambda x: 1 if x else (2 if a else (3 if b else 4))\n",
+ # Each conditional sits in its parent's consequence, so it nests; an
+ # else-arm chain reads flat like an elif dispatch (#3338).
+ "def outer():\n return lambda x: ((1 if b else 2) if a else 3) if x else 4\n",
"outer",
),
(