Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.
Python aicode-complexitycode-healthcode-intelligencecode-qualitydead-codedeveloper-toolsdocumentationgit-analyticsmcpopen-sourcepythonrefactoringstatic-analysistechnical-debt
test(cli): import scipy.sparse before the real-call guard so its CPU probe is not refused (#4024)
Raghav Chamadiyabea064e48e67
diff --git a/tests/unit/cli/_real_call_guard.py b/tests/unit/cli/_real_call_guard.pyindex 34ea30279..b37e15286 100644--- a/tests/unit/cli/_real_call_guard.py+++ b/tests/unit/cli/_real_call_guard.py@@ -8,6 +8,7 @@ guard, since its monkeypatch runs after this one.from __future__ import annotations+import contextlibimport osimport socketimport subprocess@@ -42,6 +43,10 @@ def guard_real_calls(monkeypatch: pytest.MonkeyPatch, *, allow_git: bool = FalseWindows asyncio loop) and the OS-assigned port fallback use, and theynever claim a real port."""+ # The first scipy.sparse import (networkx pagerank) probes the CPU with lscpu on Linux.+ with contextlib.suppress(ImportError):+ import scipy.sparse # noqa: F401+real_popen_init = subprocess.Popen.__init__def _popen_init(self, args, *a, **kw):