Skip to content

The agent that grows with you

fix(tests): stub _ensure_vercel_sdk in vercel sandbox tests — CI has no vercel dist

Teknium8eb06e75b9db
diff --git a/tests/tools/test_vercel_sandbox_environment.py b/tests/tools/test_vercel_sandbox_environment.py
index 13225a35975..65eb1ba2a85 100644
--- a/tests/tools/test_vercel_sandbox_environment.py
+++ b/tests/tools/test_vercel_sandbox_environment.py
@@ -221,7 +221,17 @@ def vercel_module(vercel_sdk, monkeypatch):
monkeypatch.setattr("tools.credential_files.iter_cache_files", lambda **kwargs: [])
module = importlib.import_module("tools.environments.vercel_sandbox")
- return importlib.reload(module)
+ module = importlib.reload(module)
+ # These tests fully fake the vercel SDK via sys.modules (vercel_sdk
+ # fixture) — the real package is never exercised, so the lazy-install
+ # probe must not run: _ensure_vercel_sdk checks installed DISTRIBUTION
+ # metadata (not sys.modules), and on a host without the vercel dist +
+ # with lazy installs disabled (any hermetic env) it raises ImportError
+ # before the fake SDK is ever reached. 16 tests failed exactly this way
+ # in CI while passing on dev boxes that happened to have vercel==0.7.2
+ # installed.
+ monkeypatch.setattr(module, "_ensure_vercel_sdk", lambda: None)
+ return module
@pytest.fixture()