File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
tests/unittests/integration Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,19 @@ async def fake_acompletion(*args, **kwargs):
6868 monkeypatch .setattr ("litellm.completion" , fake_completion )
6969 monkeypatch .setattr ("litellm.acompletion" , fake_acompletion )
7070
71+ # Also patch the module-level imports in google.adk.models.lite_llm
72+ # Google ADK imports acompletion at module level, so we need to patch
73+ # there as well to ensure the mock is used in all contexts
74+ try :
75+ import google .adk .models .lite_llm as lite_llm_module
76+
77+ monkeypatch .setattr (
78+ lite_llm_module , "acompletion" , fake_acompletion
79+ )
80+ monkeypatch .setattr (lite_llm_module , "completion" , fake_completion )
81+ except ImportError :
82+ pass # google.adk not installed, skip patching
83+
7184 def _setup_respx (self ):
7285 """Setup respx to intercept all httpx requests to mock base URL"""
7386
You can’t perform that action at this time.
0 commit comments